def on_query_completions(self, view, prefix, locations):
project = get_or_create_project_and_add_view(view)
if project and project.is_initialized():
pos = view.sel()[0].begin()
(line, col) = view.rowcol(pos)
Debug('autocomplete', "on_query_completions(), sublime wants to see the results, cursor currently at %i , %i (enabled: %s, items: %i)" % (line+1, col+1, project.completion.enabled_for['viewid'], len(project.completion.get_list()) ) )
if project.completion.enabled_for['viewid'] == view.id():
project.completion.enabled_for['viewid'] = -1 # receive only once
return (project.completion.get_list(), sublime.INHIBIT_WORD_COMPLETIONS | sublime.INHIBIT_EXPLICIT_COMPLETIONS)
# ON QUERY CONTEXT (execute commandy only on opened .ts files)
评论列表
文章目录