mirror of
https://github.com/davidhalter/jedi.git
synced 2026-09-03 05:27:00 +08:00
magic_method -> magic_function
This commit is contained in:
@@ -192,7 +192,7 @@ class Script(object):
|
|||||||
debug.dbg('possible scopes', scopes)
|
debug.dbg('possible scopes', scopes)
|
||||||
for s in scopes:
|
for s in scopes:
|
||||||
if s.isinstance(er.Function):
|
if s.isinstance(er.Function):
|
||||||
names = s.get_magic_method_names()
|
names = s.get_magic_function_names()
|
||||||
else:
|
else:
|
||||||
if isinstance(s, imports.ImportPath):
|
if isinstance(s, imports.ImportPath):
|
||||||
under = like + self._user_context.get_path_after_cursor()
|
under = like + self._user_context.get_path_after_cursor()
|
||||||
|
|||||||
@@ -372,7 +372,7 @@ class Evaluator(object):
|
|||||||
else:
|
else:
|
||||||
# The function must not be decorated with something else.
|
# The function must not be decorated with something else.
|
||||||
if type.isinstance(er.Function):
|
if type.isinstance(er.Function):
|
||||||
type = type.get_magic_method_scope()
|
type = type.get_magic_function_scope()
|
||||||
else:
|
else:
|
||||||
# This is the typical lookup while chaining things.
|
# This is the typical lookup while chaining things.
|
||||||
if filter_private_variable(type, scope, current):
|
if filter_private_variable(type, scope, current):
|
||||||
|
|||||||
@@ -375,10 +375,10 @@ class Function(use_metaclass(CachedMetaClass, pr.IsScope)):
|
|||||||
return Function(self._evaluator, self.base_func, True)
|
return Function(self._evaluator, self.base_func, True)
|
||||||
return decorated_func
|
return decorated_func
|
||||||
|
|
||||||
def get_magic_method_names(self):
|
def get_magic_function_names(self):
|
||||||
return compiled.magic_function_scope(self._evaluator).get_defined_names()
|
return compiled.magic_function_scope(self._evaluator).get_defined_names()
|
||||||
|
|
||||||
def get_magic_method_scope(self):
|
def get_magic_function_scope(self):
|
||||||
return compiled.magic_function_scope(self._evaluator)
|
return compiled.magic_function_scope(self._evaluator)
|
||||||
|
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
|
|||||||
Reference in New Issue
Block a user