mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
lsp: Fix completions when editing existing item
Many completion snippets insert more than just the name. For example, the object completer inserts the braces and places your cursor inside them automatically, to save some typing. However, if you're changing the class of an existing object, this isn't what you want. Changed so that if the next token is '{', only the name is inserted. Made similar changes to the property and signal completers.
This commit is contained in:
parent
8c6f8760f7
commit
3ba85d1e47
13 changed files with 122 additions and 97 deletions
|
@ -143,7 +143,7 @@ class ExtAdwResponseDialog(AstNode):
|
|||
applies_in_subclass=("Adw", "MessageDialog"),
|
||||
matches=new_statement_patterns,
|
||||
)
|
||||
def complete_adw_message_dialog(lsp, ast_node, match_variables):
|
||||
def complete_adw_message_dialog(_ctx: CompletionContext):
|
||||
yield Completion(
|
||||
"responses", CompletionItemKind.Keyword, snippet="responses [\n\t$0\n]"
|
||||
)
|
||||
|
@ -154,7 +154,7 @@ def complete_adw_message_dialog(lsp, ast_node, match_variables):
|
|||
applies_in_subclass=("Adw", "AlertDialog"),
|
||||
matches=new_statement_patterns,
|
||||
)
|
||||
def complete_adw_alert_dialog(lsp, ast_node, match_variables):
|
||||
def complete_adw_alert_dialog(_ctx: CompletionContext):
|
||||
yield Completion(
|
||||
"responses", CompletionItemKind.Keyword, snippet="responses [\n\t$0\n]"
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue