Page 1 of 1

Snippet and autocomplete

Posted: Sun Oct 08, 2017 1:36 pm
by cheina97
Goodmorning, i'm new on this website.
I'm Cheina and i'm from Italy, so sorry for my horrible english.
I noticed that in Codelite i'm unable to add my Snippets to the autocomplete.
For example, when i write "for" i can only see the key word "for" and when i press enter it doesn't write for($=0,$<@,$++).
i'm a bit confused, i didn't understand if there's something wrong or if i want to do something that is not possible.
Maybe that's a stupid question, but the autocomplete is based on the compiler or on the IDE?
Thank you for reading.

Re: Snippet and autocomplete

Posted: Sun Oct 08, 2017 2:55 pm
by eranif
The Snippet plugin was developed by a third party.
I did look at the code and it seems that it only works for C++ files

However, it does not work the way you think it should...
The completion box does not trigger the snippets, it only adds what you see in the completion box.

You could try and use the abbreviation plugin which kinda does what you are looking for (however, the multiple caret support will be out as part of CodeLite 11, due date: this week)

1. From Plugins->Abbreviations->Settings
2. Add new abbreviation named "for_php"
3. Use the pipe ("|") to indicate where the caret should be placed
4. Use Ctrl-Alt-SPACE to get the abbreviation completion box

See images attached
abb-1.png
abb-2.png
abb-3.png

Re: Snippet and autocomplete

Posted: Sun Oct 08, 2017 5:49 pm
by cheina97
Thank you for the good explanation.
So there is no way to add an abbreviation to the auto-completition?