1
0
forked from VimPlug/jedi

Starting to create a way of how context sensitive completions can be made.

This involves playing heavily with the parser pgen2. We use its stack to check for all possible tokens/keywords.
This commit is contained in:
Dave Halter
2016-05-23 18:11:44 +02:00
parent 36a135c347
commit d4a10929e2
8 changed files with 264 additions and 59 deletions

View File

@@ -186,7 +186,7 @@ class Script(object):
return new_defs
goto_path = self._user_context.get_path_under_cursor()
context = self._user_context.get_context()
context = self._user_context.get_reverse_context()
definitions = []
if next(context) in ('class', 'def'):
definitions = [self._evaluator.wrap(self._parser.user_scope())]
@@ -253,7 +253,7 @@ class Script(object):
return definitions
goto_path = self._user_context.get_path_under_cursor()
context = self._user_context.get_context()
context = self._user_context.get_reverse_context()
user_stmt = self._parser.user_stmt()
user_scope = self._parser.user_scope()