Disable completer if applies_in_subclass type is not found

https://gitlab.gnome.org/jwestman/blueprint-compiler/-/merge_requests/177#note_1990521
This commit is contained in:
Sonny Piers 2024-01-30 11:02:34 +01:00
parent ba8b492134
commit 05d6ff1fd7

View file

@ -51,7 +51,7 @@ def completer(applies_in: T.List, matches: T.List = [], applies_in_subclass=None
type = ast_node.root.gir.get_type( type = ast_node.root.gir.get_type(
applies_in_subclass[1], applies_in_subclass[0] applies_in_subclass[1], applies_in_subclass[0]
) )
if ast_node.gir_class and not ast_node.gir_class.assignable_to(type): if not ast_node.gir_class or not ast_node.gir_class.assignable_to(type):
return return
any_match = len(matches) == 0 any_match = len(matches) == 0