def on_query_completions(self, view: sublime.View, prefix: str, locations: List[Tuple[int]]) -> Tuple[List[Tuple[str]], int]: # noqa
"""Sublime Text autocompletion event handler
"""
if not is_python(view, autocomplete_ignore_repl=True):
return
if completion_is_disabled(view):
return
global JUST_COMPLETED
if self.ready_from_defer is True:
completion_flags = 0
if get_settings(view, 'suppress_word_completions', False):
completion_flags = sublime.INHIBIT_WORD_COMPLETIONS
if get_settings(view, 'suppress_explicit_completions', False):
completion_flags |= sublime.INHIBIT_EXPLICIT_COMPLETIONS
cpl = self.completions
self.completions = []
self.ready_from_defer = False
JUST_COMPLETED = True
return (cpl, completion_flags)
location = view.rowcol(locations[0])
data = prepare_send_data(location, 'autocomplete', 'jedi')
Worker().execute(self._complete, **data)
评论列表
文章目录