1
0
forked from VimPlug/jedi

NamePart migration of Definition is complete. Now Completion.

This commit is contained in:
Dave Halter
2014-09-10 18:29:10 +02:00
parent 2aa538999e
commit 0eea30f227
4 changed files with 18 additions and 14 deletions

View File

@@ -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

View File

@@ -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: