forked from VimPlug/jedi
use GlobalNamespace differently
This commit is contained in:
@@ -377,7 +377,7 @@ class Script(object):
|
|||||||
scopes |= keywords.keywords(string=goto_path, pos=self._pos)
|
scopes |= keywords.keywords(string=goto_path, pos=self._pos)
|
||||||
|
|
||||||
d = set([api_classes.Definition(s) for s in scopes
|
d = set([api_classes.Definition(s) for s in scopes
|
||||||
if not isinstance(s, imports.ImportPath._GlobalNamespace)])
|
if s is not imports.ImportPath.GlobalNamespace])
|
||||||
return self._sorted_defs(d)
|
return self._sorted_defs(d)
|
||||||
|
|
||||||
@api_classes._clear_caches_after_call
|
@api_classes._clear_caches_after_call
|
||||||
@@ -392,7 +392,7 @@ class Script(object):
|
|||||||
"""
|
"""
|
||||||
results, _ = self._goto()
|
results, _ = self._goto()
|
||||||
d = [api_classes.Definition(d) for d in set(results)
|
d = [api_classes.Definition(d) for d in set(results)
|
||||||
if not isinstance(d, imports.ImportPath._GlobalNamespace)]
|
if d is not imports.ImportPath.GlobalNamespace]
|
||||||
return self._sorted_defs(d)
|
return self._sorted_defs(d)
|
||||||
|
|
||||||
def _goto(self, add_import_name=False):
|
def _goto(self, add_import_name=False):
|
||||||
|
|||||||
@@ -39,11 +39,11 @@ class ImportPath(pr.Base):
|
|||||||
"""
|
"""
|
||||||
An ImportPath is the path of a `pr.Import` object.
|
An ImportPath is the path of a `pr.Import` object.
|
||||||
"""
|
"""
|
||||||
class _GlobalNamespace(object):
|
class GlobalNamespace(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.line_offset = 0
|
self.line_offset = 0
|
||||||
|
|
||||||
GlobalNamespace = _GlobalNamespace()
|
GlobalNamespace = GlobalNamespace()
|
||||||
|
|
||||||
def __init__(self, import_stmt, is_like_search=False, kill_count=0,
|
def __init__(self, import_stmt, is_like_search=False, kill_count=0,
|
||||||
direct_resolve=False, is_just_from=False):
|
direct_resolve=False, is_just_from=False):
|
||||||
|
|||||||
Reference in New Issue
Block a user