forked from VimPlug/jedi
Fix an issue for stdlib regex completion. deep_ast_copy had a bug and also changed the way how decorators work.
This commit is contained in:
@@ -69,7 +69,7 @@ def deep_ast_copy(obj, new_elements_default=None):
|
|||||||
pass
|
pass
|
||||||
elif key in ['parent_function', 'use_as_parent', '_sub_module']:
|
elif key in ['parent_function', 'use_as_parent', '_sub_module']:
|
||||||
continue
|
continue
|
||||||
elif key == '_names_dict':
|
elif key == 'names_dict':
|
||||||
d = dict((k, sequence_recursion(v)) for k, v in value.items())
|
d = dict((k, sequence_recursion(v)) for k, v in value.items())
|
||||||
setattr(new_obj, key, d)
|
setattr(new_obj, key, d)
|
||||||
elif isinstance(value, (list, tuple)):
|
elif isinstance(value, (list, tuple)):
|
||||||
|
|||||||
@@ -478,10 +478,14 @@ class Function(use_metaclass(CachedMetaClass, Wrapper)):
|
|||||||
This is also the places where the decorators are processed.
|
This is also the places where the decorators are processed.
|
||||||
"""
|
"""
|
||||||
f = self.base_func
|
f = self.base_func
|
||||||
|
decorators = self.base_func.get_decorators()
|
||||||
|
|
||||||
|
if not decorators or self.is_decorated:
|
||||||
|
return self
|
||||||
|
|
||||||
# Only enter it, if has not already been processed.
|
# Only enter it, if has not already been processed.
|
||||||
if not self.is_decorated:
|
if not self.is_decorated:
|
||||||
for dec in reversed(self.base_func.get_decorators()):
|
for dec in reversed(decorators):
|
||||||
debug.dbg('decorator: %s %s', dec, f)
|
debug.dbg('decorator: %s %s', dec, f)
|
||||||
dec.children
|
dec.children
|
||||||
dec_results = self._evaluator.eval_element(dec.children[1])
|
dec_results = self._evaluator.eval_element(dec.children[1])
|
||||||
@@ -515,9 +519,6 @@ class Function(use_metaclass(CachedMetaClass, Wrapper)):
|
|||||||
f.decorates = self
|
f.decorates = self
|
||||||
|
|
||||||
debug.dbg('decorator end %s', f)
|
debug.dbg('decorator end %s', f)
|
||||||
|
|
||||||
if isinstance(f, (pr.Function, pr.Lambda)):
|
|
||||||
return self
|
|
||||||
return f
|
return f
|
||||||
|
|
||||||
def get_magic_function_names(self):
|
def get_magic_function_names(self):
|
||||||
@@ -618,7 +619,7 @@ class FunctionExecution(Executed):
|
|||||||
break
|
break
|
||||||
return types
|
return types
|
||||||
|
|
||||||
@property
|
@common.safe_property
|
||||||
@underscore_memoization
|
@underscore_memoization
|
||||||
def names_dict(self):
|
def names_dict(self):
|
||||||
d = {}
|
d = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user