1
0
forked from VimPlug/jedi

REPL completion is working again partially. There's some progress at least.

This commit is contained in:
Dave Halter
2016-06-29 08:49:20 +02:00
parent 52c42c3392
commit a3b263a599
7 changed files with 41 additions and 35 deletions
+1
View File
@@ -115,6 +115,7 @@ class CompiledObject(Base):
elif inspect.isbuiltin(cls) or inspect.ismethod(cls) \
or inspect.ismethoddescriptor(cls) or inspect.isfunction(cls):
return 'function'
raise NotImplementedError
@property
def type(self):
+10 -2
View File
@@ -7,8 +7,7 @@ import inspect
from jedi import common
from jedi.parser.fast import FastParser
from jedi.evaluate import compiled
from jedi.cache import underscore_memoization, memoize_method
from jedi.evaluate.cache import memoize_default
from jedi.cache import underscore_memoization
class MixedObject(object):
@@ -38,6 +37,15 @@ class MixedObject(object):
assert search_global is False
return [LazyMixedNamesDict(self._evaluator, self, is_instance=False)]
def api_type(self):
mappings = {
'expr_stmt': 'statement',
'classdef': 'class',
'funcdef': 'function',
'file_input': 'module',
}
return mappings[self._definition.type]
def __repr__(self):
return '<%s: %s>' % (type(self).__name__, repr(self.obj))
+2
View File
@@ -559,6 +559,8 @@ def global_names_dict_generator(evaluator, scope, position):
for names_dict in scope.names_dicts(True):
yield names_dict, position
if hasattr(scope, 'resets_positions'):
position = None
if scope.type == 'funcdef':
# The position should be reset if the current scope is a function.
in_func = True