diff --git a/jedi/__init__.py b/jedi/__init__.py index a97fa88c..83b69efa 100644 --- a/jedi/__init__.py +++ b/jedi/__init__.py @@ -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) diff --git a/jedi/api.py b/jedi/api.py index fb7f2d09..dd4dd5e9 100644 --- a/jedi/api.py +++ b/jedi/api.py @@ -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 - [, , ...] - - :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() diff --git a/test/test_regression.py b/test/test_regression.py index 783c4c9e..ca1b87b6 100755 --- a/test/test_regression.py +++ b/test/test_regression.py @@ -430,27 +430,6 @@ class TestFeature(TestBase): any_re""" self.assertEqual(self.goto_definitions(s)[0].full_name, 're.RegexObject') - def test_quick_completion(self): - sources = [ - ('import json; json.l', (1, 19)), - ('import json; json.l ', (1, 19)), - ('import json\njson.l', (2, 6)), - ('import json\njson.l ', (2, 6)), - ('import json\njson.l\n\n', (2, 6)), - ('import json\njson.l \n\n', (2, 6)), - ('import json\njson.l \n \n\n', (2, 6)), - ] - for source, pos in sources: - # Run quick_complete - quick_completions = api._quick_complete(source) - # Run real completion - script = jedi.Script(source, pos[0], pos[1], '') - real_completions = script.completions() - # Compare results - quick_values = [(c.full_name, c.line, c.column) for c in quick_completions] - real_values = [(c.full_name, c.line, c.column) for c in real_completions] - self.assertEqual(quick_values, real_values) - class TestGetDefinitions(TestBase):