mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
completions: Add completions for response IDs
This commit is contained in:
parent
866092ccf7
commit
b26433d865
16 changed files with 123 additions and 42 deletions
|
@ -68,10 +68,22 @@ def completer(applies_in: T.List, matches: T.List = [], applies_in_subclass=None
|
|||
# For completers that apply in ObjectContent nodes, we can further
|
||||
# check that the object is the right class
|
||||
if applies_in_subclass is not None:
|
||||
type = ast_node.root.gir.get_type(
|
||||
applies_in_subclass[1], applies_in_subclass[0]
|
||||
)
|
||||
if not ast_node.gir_class or not ast_node.gir_class.assignable_to(type):
|
||||
parent_obj = ast_node
|
||||
while parent_obj is not None and not hasattr(parent_obj, "gir_class"):
|
||||
parent_obj = parent_obj.parent
|
||||
|
||||
if (
|
||||
parent_obj is None
|
||||
or not parent_obj.gir_class
|
||||
or not any(
|
||||
[
|
||||
parent_obj.gir_class.assignable_to(
|
||||
parent_obj.root.gir.get_type(c[1], c[0])
|
||||
)
|
||||
for c in applies_in_subclass
|
||||
]
|
||||
)
|
||||
):
|
||||
return
|
||||
|
||||
any_match = len(matches) == 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue