mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
fix autocomplete crash in ycmd
Signed-off-by: Yusheng.Ma <Yusheng.Ma@zilliz.com>
This commit is contained in:
@@ -86,6 +86,8 @@ class StubFilter(ParserTreeFilter):
|
|||||||
# Imports in stub files are only public if they have an "as"
|
# Imports in stub files are only public if they have an "as"
|
||||||
# export.
|
# export.
|
||||||
definition = name.get_definition()
|
definition = name.get_definition()
|
||||||
|
if definition is None:
|
||||||
|
return False
|
||||||
if definition.type in ('import_from', 'import_name'):
|
if definition.type in ('import_from', 'import_name'):
|
||||||
if name.parent.type not in ('import_as_name', 'dotted_as_name'):
|
if name.parent.type not in ('import_as_name', 'dotted_as_name'):
|
||||||
return False
|
return False
|
||||||
|
|||||||
@@ -78,6 +78,8 @@ class ClassName(TreeNameDefinition):
|
|||||||
type_ = super().api_type
|
type_ = super().api_type
|
||||||
if type_ == 'function':
|
if type_ == 'function':
|
||||||
definition = self.tree_name.get_definition()
|
definition = self.tree_name.get_definition()
|
||||||
|
if definition is None:
|
||||||
|
return type_
|
||||||
if function_is_property(definition):
|
if function_is_property(definition):
|
||||||
# This essentially checks if there is an @property before
|
# This essentially checks if there is an @property before
|
||||||
# the function. @property could be something different, but
|
# the function. @property could be something different, but
|
||||||
|
|||||||
Reference in New Issue
Block a user