forked from VimPlug/jedi
NamePart migration of Definition is complete. Now Completion.
This commit is contained in:
@@ -267,12 +267,16 @@ class NameFinder(object):
|
||||
# check for `except X as y` usages, because y needs to be instantiated.
|
||||
p = stmt.parent
|
||||
# TODO this looks really hacky, improve parser representation!
|
||||
if isinstance(p, pr.Flow) and p.command == 'except' \
|
||||
and p.inputs and p.inputs[0].as_names[0].names[-1] == name:
|
||||
# TODO check for types that are not classes and add it to the
|
||||
# static analysis report.
|
||||
types = list(chain.from_iterable(
|
||||
evaluator.execute(t) for t in types))
|
||||
if isinstance(p, pr.Flow) and p.command == 'except' and p.inputs:
|
||||
as_names = p.inputs[0].as_names
|
||||
try:
|
||||
if as_names[0].names[-1] == name:
|
||||
# TODO check for types that are not classes and add it to
|
||||
# the static analysis report.
|
||||
types = list(chain.from_iterable(
|
||||
evaluator.execute(t) for t in types))
|
||||
except IndexError:
|
||||
pass
|
||||
|
||||
if check_instance is not None:
|
||||
# class renames
|
||||
|
||||
@@ -196,7 +196,7 @@ class ImportWrapper(pr.Base):
|
||||
|
||||
# goto only accepts Names or NameParts
|
||||
if is_goto and not rest:
|
||||
scopes = [s.name for s in scopes]
|
||||
scopes = [s.name.names[-1] for s in scopes]
|
||||
|
||||
# follow the rest of the import (not FS -> classes, functions)
|
||||
if len(rest) > 1 or rest and self.is_like_search:
|
||||
|
||||
Reference in New Issue
Block a user