Sublime Forum

[solved] How to programatically add auto completions?

#1

I would like to provide autocompletions much like snippets that are triggered as you type. It should also show as pop up autocompletion.

The words are provided by my plugin as a list.

I have a sample plugin but couldn’t exactly find out how it is done. It seems to use a text command and view.insert and it is triggered every time a sequence of characters is entered.

0 Likes

#2

If you want to programmatically provide auto completions, you will need to look in to on_query_completions of sublime_plugin.EventListener or sublime_plugin.ViewEventListener depending on your needs.

Here are the docs for it
https://www.sublimetext.com/docs/api_reference.html#sublime_plugin.EventListener:ver-dev

Here is also a good video that describes in detail about this API endpoint.

2 Likes