1
0
forked from VimPlug/jedi

Improve Name.is_definition

This commit is contained in:
Dave Halter
2014-11-02 17:53:04 +01:00
parent 81174741a4
commit f4d7020ebf

View File

@@ -255,8 +255,11 @@ class Name(Leaf):
def is_definition(self):
stmt = self.get_definition()
return isinstance(stmt, (ExprStmt, Import)) \
and self in stmt.get_defined_names()
if isinstance(stmt, (Function, Class, Module)):
return True
else:
return isinstance(stmt, (ExprStmt, Import)) \
and self in stmt.get_defined_names()
def assignment_indexes(self):
"""