1
0
forked from VimPlug/jedi

submodules are automatically indexed without actually importing them. fixes #413.

However, this is not a 100% correct Python behavior. Python behavior would be to follow ALL imports in all modules (recursively) and check if the module was imported. However, that's a lot of work, that would slow down autocompletion. For now it's better to have no false positives in flaking and to ignore a few attribute errors.
This commit is contained in:
Dave Halter
2014-06-25 01:30:59 +02:00
parent 034a818863
commit 44238a9f92
4 changed files with 31 additions and 5 deletions
+3 -3
View File
@@ -73,8 +73,8 @@ class NameFinder(object):
gen = self.scope.scope_names_generator
except AttributeError:
if isinstance(self.scope, er.Class):
# classes are only available directly via chaining?
# strange stuff...
# Classes don't have a positional limitation of their
# state. It's the whole class.
names = self.scope.get_defined_names()
else:
names = _get_defined_names_for_position(self.scope, self.position)
@@ -118,7 +118,7 @@ class NameFinder(object):
self._last_filter_name_scope = name_list_scope
scope_txt = (self.scope if self.scope == name_list_scope
else ('%s-%s' % self.scope, name_list_scope))
else '%s-%s' % (self.scope, name_list_scope))
debug.dbg('finder.filter_name "%s" in (%s): %s@%s', self.name_str,
scope_txt, u(result), self.position)
return result