forked from VimPlug/jedi
Remove NamePart from existance and rename it to Name.
This commit is contained in:
@@ -245,12 +245,12 @@ def get_instance_el(evaluator, instance, var, is_class_var=False):
|
||||
untouched.
|
||||
"""
|
||||
if isinstance(var, (Instance, compiled.CompiledObject, pr.Operator, Token,
|
||||
pr.Module, FunctionExecution, pr.NamePart)):
|
||||
if isinstance(var, pr.NamePart):
|
||||
# TODO temp solution, remove later, NameParts should never get
|
||||
pr.Module, FunctionExecution, pr.Name)):
|
||||
if isinstance(var, pr.Name):
|
||||
# TODO temp solution, remove later, Name should never get
|
||||
# here?
|
||||
par = get_instance_el(evaluator, instance, var.parent, is_class_var)
|
||||
return pr.NamePart(var._sub_module, unicode(var), par, var.start_pos)
|
||||
return pr.Name(var._sub_module, unicode(var), par, var.start_pos)
|
||||
return var
|
||||
|
||||
var = wrap(evaluator, var)
|
||||
@@ -282,8 +282,8 @@ class InstanceElement(use_metaclass(CachedMetaClass, pr.Base)):
|
||||
return par
|
||||
|
||||
def get_parent_until(self, *args, **kwargs):
|
||||
if isinstance(self.var, pr.NamePart):
|
||||
# TODO NameParts should never even be InstanceElements
|
||||
if isinstance(self.var, pr.Name):
|
||||
# TODO Name should never even be InstanceElements
|
||||
return pr.Simple.get_parent_until(self.parent, *args, **kwargs)
|
||||
return pr.Simple.get_parent_until(self, *args, **kwargs)
|
||||
|
||||
@@ -694,7 +694,7 @@ class ModuleWrapper(use_metaclass(CachedMetaClass, pr.Module, Wrapper)):
|
||||
@property
|
||||
@memoize_default()
|
||||
def name(self):
|
||||
return pr.NamePart(self, unicode(self.base.name), self, (1, 0))
|
||||
return pr.Name(self, unicode(self.base.name), self, (1, 0))
|
||||
|
||||
@memoize_default()
|
||||
def _sub_modules(self):
|
||||
|
||||
Reference in New Issue
Block a user