forked from VimPlug/jedi
Improve Name.is_definition
This commit is contained in:
@@ -255,6 +255,9 @@ class Name(Leaf):
|
|||||||
|
|
||||||
def is_definition(self):
|
def is_definition(self):
|
||||||
stmt = self.get_definition()
|
stmt = self.get_definition()
|
||||||
|
if isinstance(stmt, (Function, Class, Module)):
|
||||||
|
return True
|
||||||
|
else:
|
||||||
return isinstance(stmt, (ExprStmt, Import)) \
|
return isinstance(stmt, (ExprStmt, Import)) \
|
||||||
and self in stmt.get_defined_names()
|
and self in stmt.get_defined_names()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user