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

@ -28,19 +28,21 @@ class ExtResponse(AstNode):
ALLOWED_PARENTS: T.List[T.Tuple[str, str]] = [("Gtk", "Dialog"), ("Gtk", "InfoBar")]
grammar = [
grammar = Statement(
"[",
Keyword("action"),
Keyword("response"),
"=",
Match("=").expected(),
AnyOf(
UseIdent("response_id"),
[
Optional(UseExact("sign", "-")),
UseNumber("response_id"),
],
),
).expected("response ID"),
Optional([Keyword("default"), UseLiteral("is_default", True)]),
]
end="]",
)
@validate()
def parent_has_action_widgets(self) -> None: