LiteIDE - Code Snippets?

Hi,
Does anyone know where LiteIDE’s code snippets function is documented or how it works please?

The only reference I can find is here in the roadmap:
“Code snippets (issue #16) (done)”

code snippets are in the file $HOME/liteide/share/liteide/packages/go/go.snippet.json. like the name says is a json format and you can extend the existing snippets conveniently. for example, if you insert

{
 "info" : "test snippet",
 "name" : "test",
 "text" : "test($write here$){\n\t\n}"
},

as you see, we have a snippet name, a description (info) and the code inserted.
when you press t in LiteIDE and you chose test the text section will be inserted. note that $ sign mark the region where the prompt will remain.

another example:

{
 "info" : "test snippet",
 "name" : "test",
 "text" : "test(){\n\t$$\n}"
},

this will do the same thing but will put the cursor inside the function.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.