1
0
forked from VimPlug/jedi

Fix an issue with api_name of class attributes, fixes #1688

This commit is contained in:
Dave Halter
2020-12-28 00:29:30 +01:00
parent 0f128c6deb
commit 04c1c0f871
3 changed files with 30 additions and 10 deletions

View File

@@ -75,17 +75,17 @@ class ClassName(TreeNameDefinition):
@property
def api_type(self):
if self.tree_name is not None:
type_ = super().api_type
if type_ == 'function':
definition = self.tree_name.get_definition()
if definition.type == 'funcdef':
if function_is_property(definition):
# This essentially checks if there is an @property before
# the function. @property could be something different, but
# any programmer that redefines property as something that
# is not really a property anymore, should be shot. (i.e.
# this is a heuristic).
return 'property'
return super().api_type
if function_is_property(definition):
# This essentially checks if there is an @property before
# the function. @property could be something different, but
# any programmer that redefines property as something that
# is not really a property anymore, should be shot. (i.e.
# this is a heuristic).
return 'property'
return type_
class ClassFilter(ParserTreeFilter):