mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-25 01:38:36 +08:00
completions -> complete, see #1166
This commit is contained in:
+11
-3
@@ -201,21 +201,29 @@ class Script(object):
|
|||||||
self._inference_state.environment,
|
self._inference_state.environment,
|
||||||
)
|
)
|
||||||
|
|
||||||
def completions(self, fuzzy=False):
|
def complete(self, line=None, column=None, **kwargs):
|
||||||
"""
|
"""
|
||||||
Return :class:`classes.Completion` objects. Those objects contain
|
Return :class:`classes.Completion` objects. Those objects contain
|
||||||
information about the completions, more than just names.
|
information about the completions, more than just names.
|
||||||
|
|
||||||
:return: Completion objects, sorted by name and __ comes last.
|
:param fuzzy: Default False. Will return fuzzy completions, which means
|
||||||
|
that e.g. ``ooa`` will match ``foobar``.
|
||||||
|
:return: Completion objects, sorted by name and ``__`` comes last.
|
||||||
:rtype: list of :class:`classes.Completion`
|
:rtype: list of :class:`classes.Completion`
|
||||||
"""
|
"""
|
||||||
|
return self._complete(line, column, **kwargs)
|
||||||
|
|
||||||
|
def _complete(self, line, column, fuzzy): # Python 2...
|
||||||
with debug.increase_indent_cm('completions'):
|
with debug.increase_indent_cm('completions'):
|
||||||
completion = Completion(
|
completion = Completion(
|
||||||
self._inference_state, self._get_module_context(), self._code_lines,
|
self._inference_state, self._get_module_context(), self._code_lines,
|
||||||
self._pos, self.call_signatures
|
(line, column), self.call_signatures
|
||||||
)
|
)
|
||||||
return completion.completions(fuzzy)
|
return completion.completions(fuzzy)
|
||||||
|
|
||||||
|
def completions(self, fuzzy=False):
|
||||||
|
return self.complete(*self._pos, fuzzy=fuzzy)
|
||||||
|
|
||||||
def goto_definitions(self, **kwargs):
|
def goto_definitions(self, **kwargs):
|
||||||
"""
|
"""
|
||||||
Return the definitions of a the path under the cursor. goto function!
|
Return the definitions of a the path under the cursor. goto function!
|
||||||
|
|||||||
Reference in New Issue
Block a user