mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 09:03:31 +07:00
Fix collecting runtime type information (PY-17722)
Because of incorrect function name, type information was collected for library functions, but not for project functions
This commit is contained in:
@@ -393,7 +393,7 @@ class PyDB:
|
||||
return self.plugin
|
||||
|
||||
def not_in_scope(self, filename):
|
||||
return pydevd_utils.is_in_project_roots(filename)
|
||||
return pydevd_utils.not_in_project_roots(filename)
|
||||
|
||||
def first_appearance_in_scope(self, trace):
|
||||
if trace is None or self.not_in_scope(trace.tb_frame.f_code.co_filename):
|
||||
|
||||
@@ -32,9 +32,10 @@ class Signature(object):
|
||||
class SignatureFactory(object):
|
||||
def __init__(self):
|
||||
self._caller_cache = {}
|
||||
self._ignore_module_name = ('__main__', '__builtin__', 'builtins')
|
||||
|
||||
def is_in_scope(self, filename):
|
||||
return pydevd_utils.is_in_project_roots(filename)
|
||||
return not pydevd_utils.not_in_project_roots(filename)
|
||||
|
||||
def create_signature(self, frame):
|
||||
try:
|
||||
@@ -50,7 +51,7 @@ class SignatureFactory(object):
|
||||
tp = locals[name].__class__
|
||||
class_name = tp.__name__
|
||||
|
||||
if hasattr(tp, '__module__') and tp.__module__ and tp.__module__ != '__main__':
|
||||
if hasattr(tp, '__module__') and tp.__module__ and tp.__module__ not in self._ignore_module_name:
|
||||
class_name = "%s.%s"%(tp.__module__, class_name)
|
||||
|
||||
res.add_arg(name, class_name)
|
||||
|
||||
@@ -128,7 +128,7 @@ def _get_project_roots(project_roots_cache=[]):
|
||||
return project_roots_cache[-1] # returns the project roots with case normalized
|
||||
|
||||
|
||||
def is_in_project_roots(filename, filename_to_not_in_scope_cache={}):
|
||||
def not_in_project_roots(filename, filename_to_not_in_scope_cache={}):
|
||||
# Note: the filename_to_not_in_scope_cache is the same instance among the many calls to the method
|
||||
try:
|
||||
return filename_to_not_in_scope_cache[filename]
|
||||
|
||||
Reference in New Issue
Block a user