forked from VimPlug/jedi
fix the remaining refactoring problems
This commit is contained in:
@@ -12,6 +12,7 @@ __all__ = ['Script', 'NotFoundError', 'set_debug_function', '_quick_complete']
|
|||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
import parsing
|
||||||
import parsing_representation as pr
|
import parsing_representation as pr
|
||||||
import dynamic
|
import dynamic
|
||||||
import imports
|
import imports
|
||||||
@@ -188,7 +189,7 @@ class Script(object):
|
|||||||
return scopes
|
return scopes
|
||||||
|
|
||||||
def _get_under_cursor_stmt(self, cursor_txt):
|
def _get_under_cursor_stmt(self, cursor_txt):
|
||||||
r = pr.Parser(cursor_txt, no_docstr=True)
|
r = parsing.Parser(cursor_txt, no_docstr=True)
|
||||||
try:
|
try:
|
||||||
stmt = r.module.statements[0]
|
stmt = r.module.statements[0]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
import evaluate
|
import evaluate
|
||||||
|
import parsing
|
||||||
import parsing_representation as pr
|
import parsing_representation as pr
|
||||||
|
|
||||||
DOCSTRING_PARAM_PATTERNS = [
|
DOCSTRING_PARAM_PATTERNS = [
|
||||||
@@ -34,7 +35,7 @@ def follow_param(param):
|
|||||||
param_str)
|
param_str)
|
||||||
user_position = (2, 0)
|
user_position = (2, 0)
|
||||||
|
|
||||||
p = pr.Parser(param_str, None, user_position,
|
p = parsing.Parser(param_str, None, user_position,
|
||||||
no_docstr=True)
|
no_docstr=True)
|
||||||
return evaluate.follow_statement(p.user_stmt)
|
return evaluate.follow_statement(p.user_stmt)
|
||||||
return []
|
return []
|
||||||
@@ -98,7 +99,7 @@ def find_return_types(func):
|
|||||||
if not type_str:
|
if not type_str:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
p = pr.Parser(type_str, None, (1, 0), no_docstr=True)
|
p = parsing.Parser(type_str, None, (1, 0), no_docstr=True)
|
||||||
p.user_stmt.parent = func
|
p.user_stmt.parent = func
|
||||||
return list(evaluate.follow_statement(p.user_stmt))
|
return list(evaluate.follow_statement(p.user_stmt))
|
||||||
|
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ class CachedFastParser(type):
|
|||||||
return parsing.Parser(source, module_path, user_position)
|
return parsing.Parser(source, module_path, user_position)
|
||||||
|
|
||||||
pi = cache.parser_cache.get(module_path, None)
|
pi = cache.parser_cache.get(module_path, None)
|
||||||
if pi is None or isinstance(pi.parser, pr.Parser):
|
if pi is None or isinstance(pi.parser, parsing.Parser):
|
||||||
p = super(CachedFastParser, self).__call__(source, module_path,
|
p = super(CachedFastParser, self).__call__(source, module_path,
|
||||||
user_position)
|
user_position)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user