Reputation: 75
Like this. What API should I use to show this box?
update: I successed in sublime-text 3,but failed in sublime-text 2.Do you know why? The code is:
import sublime, sublime_plugin
class CCAutoComplete(sublime_plugin.EventListener):
def on_query_completions(self, view, prefix, locations):
flag = sublime.INHIBIT_WORD_COMPLETIONS | sublime.INHIBIT_EXPLICIT_COMPLETIONS
result = ([["abv","abv"],["abcd123","abcd"]],flag)
return result
Upvotes: 1
Views: 59
Reputation: 3833
The auto-completion panel can be manually populated with the on_query_completions listener.
To view a functioning example of it's implementation:
PackageResourceViewer: Open Resource
from the command paletteCSS
package and open css_completions.py
Upvotes: 1