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:
@@ -186,6 +186,13 @@ class FakeStatement(pr.Statement):
|
||||
self.set_expression_list(expression_list)
|
||||
|
||||
|
||||
class FakeImport(pr.Import):
|
||||
def __init__(self, name, parent):
|
||||
p = 0, 0
|
||||
super(FakeImport, self).__init__(FakeSubModule, p, p, name)
|
||||
self.parent = parent
|
||||
|
||||
|
||||
class FakeName(pr.Name):
|
||||
def __init__(self, name_or_names, parent=None):
|
||||
p = 0, 0
|
||||
|
||||
Reference in New Issue
Block a user