1
0
forked from VimPlug/jedi

Don't use UserContextParser.user_stmt anymore, since we can access it directly.

This commit is contained in:
Dave Halter
2016-06-23 16:36:12 +02:00
parent 73e71b3c1a
commit bb4ab45131
3 changed files with 3 additions and 20 deletions

View File

@@ -6,7 +6,6 @@ from jedi import cache
from jedi.parser import ParserWithRecovery
from jedi.parser.fast import FastParser
from jedi.parser import tree
from jedi import debug
# TODO this should be part of the tokenizer not just of this user_context.
Token = namedtuple('Token', ['type', 'string', 'start_pos', 'prefix'])
@@ -39,18 +38,12 @@ class UserContextParser(object):
self._parser_done_callback(parser)
return parser
@cache.underscore_memoization
def user_stmt(self):
module = self.module()
debug.speed('parsed')
return module.get_statement_for_position(self._position)
@cache.underscore_memoization
def user_scope(self):
"""
Returns the scope in which the user resides. This includes flows.
"""
user_stmt = self.user_stmt()
user_stmt = self.module().get_statement_for_position(self._position)
if user_stmt is None:
def scan(scope):
for s in scope.children: