Sublime Forum

Autocompletion send default parameters with completion

#1

So I’m trying to autocomplete this:
number(int number)

but when I type number and then press tab to perform the completion I want it to be completed like
number(1)

where 1 is the default parameter and if its possible after the 1 the cursor.
This is my autocompletion does work like this
{ "trigger": "number", "contents": "number()" }

but not like how I wanted it to be, Like this:
{ "trigger": "number", "contents": "number(1)" }

Is there a way to solve this or make this possible without the use of external scripts?

0 Likes

#2
{ "trigger": "number", "contents": "number(${1:1})" }

or

{ "trigger": "number", "contents": "number(${1:int number})" }
0 Likes

#3

I tried but that doesn’t work for me. What kind of scopes do you use with that code? Its for lua code btw.
I only use scope source.lua

edit: it does work for snippets :slightly_smiling:

0 Likes