forked from VimPlug/jedi
Few small issues.
This commit is contained in:
@@ -79,6 +79,8 @@ class NameFinder(object):
|
|||||||
search_str = str(self.name_str)
|
search_str = str(self.name_str)
|
||||||
try:
|
try:
|
||||||
names = names_dict[search_str]
|
names = names_dict[search_str]
|
||||||
|
if not names: # There must be something in there otherwise stop.
|
||||||
|
return []
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
@@ -348,7 +350,7 @@ class NameFinder(object):
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
@memoize_default(evaluator_is_first_arg=True)
|
@memoize_default([], evaluator_is_first_arg=True)
|
||||||
def _name_to_types(evaluator, name, scope):
|
def _name_to_types(evaluator, name, scope):
|
||||||
types = []
|
types = []
|
||||||
typ = name.get_definition()
|
typ = name.get_definition()
|
||||||
|
|||||||
@@ -169,6 +169,9 @@ class FakeImport(pr.Import):
|
|||||||
self._level = level
|
self._level = level
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|
||||||
|
def get_defined_names(self):
|
||||||
|
return [self.name]
|
||||||
|
|
||||||
def aliases(self):
|
def aliases(self):
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
@@ -183,6 +186,9 @@ class FakeImport(pr.Import):
|
|||||||
def paths(self):
|
def paths(self):
|
||||||
return [[self.name]]
|
return [[self.name]]
|
||||||
|
|
||||||
|
def is_definition(self):
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
class FakeName(pr.Name):
|
class FakeName(pr.Name):
|
||||||
def __init__(self, name_str, parent=None, start_pos=(0, 0), is_definition=None):
|
def __init__(self, name_str, parent=None, start_pos=(0, 0), is_definition=None):
|
||||||
|
|||||||
@@ -905,7 +905,7 @@ class ModuleWrapper(use_metaclass(CachedMetaClass, pr.Module, Wrapper)):
|
|||||||
# It's obviously a relative import to the current module.
|
# It's obviously a relative import to the current module.
|
||||||
imp = helpers.FakeImport(fake_n, self, level=1)
|
imp = helpers.FakeImport(fake_n, self, level=1)
|
||||||
fake_n.parent = imp
|
fake_n.parent = imp
|
||||||
names[name] = fake_n
|
names[name] = [fake_n]
|
||||||
|
|
||||||
# TODO add something like this in the future, its cleaner than the
|
# TODO add something like this in the future, its cleaner than the
|
||||||
# import hacks.
|
# import hacks.
|
||||||
|
|||||||
Reference in New Issue
Block a user