[SOLVED] Snippets with multiple options


I want to know if there’s a way to show a sub-snippet suggestion.

‘Element declaration’:
prefix: 'ele’
body: ‘element.’ <- At this point, the editor must show suggestions. IF user types ‘ele’, loads ‘element.’ and give suggestions of snippets based on a ‘case’ or ‘if’ inside this ‘ele’. Something like this

‘Element declaration’:
prefix: 'ele’
body: ‘element.’
—if(prefix: ‘n’)
-----body: ‘name’
—else if(prefix: ‘w’)
-----body: ‘width’

Final result would be like element.name or element.width

Any help?
Thank you.


No, there isn’t a capability like what you’re specifying built in to the snippet system. But if you create a snippet that expands ele to element. then perhaps the autocomplete system can pick that up and give the suggestions you’re looking for.


Then, in this case, the answer that I need would be accomplished creating a auto-complete package with specs and all?


Unless there is already an autocomplete package for the language you’re working with.


I looked for it, but I don’t think it exists.
It’s for autocompleting Protractor API https://angular.github.io/protractor/#/api


There’s an ‘autocomplete hello word’ package available?.. A simple example?


Check the autocomplete-plus README for the provider API documentation:


Thank you so much!