mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-24 17:28:36 +08:00
Remove api._quick_complete
This commit is contained in:
+1
-3
@@ -40,9 +40,7 @@ import sys
|
||||
# imports and circular imports... Just avoid it:
|
||||
sys.path.insert(0, __path__[0])
|
||||
|
||||
from .api import (
|
||||
Script, Interpreter, NotFoundError, set_debug_function, _quick_complete,
|
||||
)
|
||||
from .api import Script, Interpreter, NotFoundError, set_debug_function
|
||||
from . import settings
|
||||
|
||||
sys.path.pop(0)
|
||||
|
||||
-22
@@ -577,25 +577,3 @@ def set_debug_function(func_cb=debug.print_to_stdout, warnings=True,
|
||||
debug.enable_warning = warnings
|
||||
debug.enable_notice = notices
|
||||
debug.enable_speed = speed
|
||||
|
||||
|
||||
def _quick_complete(source):
|
||||
"""
|
||||
Convenience function to complete a source string at the end.
|
||||
|
||||
Example:
|
||||
|
||||
>>> _quick_complete('''
|
||||
... import datetime
|
||||
... datetime.da''') #doctest: +ELLIPSIS
|
||||
[<Completion: date>, <Completion: datetime>, ...]
|
||||
|
||||
:param source: The source code to be completed.
|
||||
:type source: string
|
||||
:return: Completion objects as returned by :meth:`complete`.
|
||||
:rtype: list of :class:`api_classes.Completion`
|
||||
"""
|
||||
lines = re.sub(r'[\n\r\s]*$', '', source).splitlines()
|
||||
pos = len(lines), len(lines[-1])
|
||||
script = Script(source, pos[0], pos[1], '')
|
||||
return script.completions()
|
||||
|
||||
Reference in New Issue
Block a user