mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
lsp: Use snippet for object completion
This commit is contained in:
parent
442fff69b6
commit
0914b7d4e9
1 changed files with 12 additions and 2 deletions
|
@ -101,7 +101,12 @@ def object_completer(lsp, ast_node, match_variables):
|
|||
ns = ast_node.root.gir.namespaces.get(match_variables[0])
|
||||
if ns is not None:
|
||||
for c in ns.classes.values():
|
||||
yield Completion(c.name, CompletionItemKind.Class, docs=c.doc)
|
||||
yield Completion(
|
||||
c.name,
|
||||
CompletionItemKind.Class,
|
||||
docs=c.doc,
|
||||
snippet=f"{c.name} {{\n $0\n}}",
|
||||
)
|
||||
|
||||
|
||||
@completer(
|
||||
|
@ -112,7 +117,12 @@ def gtk_object_completer(lsp, ast_node, match_variables):
|
|||
ns = ast_node.root.gir.namespaces.get("Gtk")
|
||||
if ns is not None:
|
||||
for c in ns.classes.values():
|
||||
yield Completion(c.name, CompletionItemKind.Class, docs=c.doc)
|
||||
yield Completion(
|
||||
c.name,
|
||||
CompletionItemKind.Class,
|
||||
docs=c.doc,
|
||||
snippet=f"{c.name} {{\n $0\n}}",
|
||||
)
|
||||
|
||||
|
||||
@completer(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue