completions: Add completions for response IDs

This commit is contained in:
James Westman 2025-01-17 16:44:21 -06:00
parent 866092ccf7
commit b26433d865
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
16 changed files with 123 additions and 42 deletions

View file

@ -140,7 +140,7 @@ class ExtAdwResponseDialog(AstNode):
@completer(
applies_in=[ObjectContent],
applies_in_subclass=("Adw", "MessageDialog"),
applies_in_subclass=[("Adw", "AlertDialog"), ("Adw", "MessageDialog")],
matches=new_statement_patterns,
)
def complete_adw_message_dialog(_ctx: CompletionContext):
@ -149,20 +149,6 @@ def complete_adw_message_dialog(_ctx: CompletionContext):
)
@completer(
applies_in=[ObjectContent],
applies_in_subclass=("Adw", "AlertDialog"),
matches=new_statement_patterns,
)
def complete_adw_alert_dialog(_ctx: CompletionContext):
yield Completion(
"responses",
CompletionItemKind.Keyword,
snippet="responses [\n\t$0\n]",
sort_text=get_sort_key(CompletionPriority.OBJECT_MEMBER, "responses"),
)
@decompiler("responses")
def decompile_responses(ctx, gir):
ctx.print(f"responses [")