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
8c102cf9dc
commit
b76f4eef50
1 changed files with 14 additions and 2 deletions
|
@ -107,7 +107,13 @@ def object_completer(lsp, ast_node, match_variables):
|
||||||
ns = ast_node.root.gir.namespaces.get(match_variables[0])
|
ns = ast_node.root.gir.namespaces.get(match_variables[0])
|
||||||
if ns is not None:
|
if ns is not None:
|
||||||
for c in ns.classes.values():
|
for c in ns.classes.values():
|
||||||
yield Completion(c.name, CompletionItemKind.Class, docs=c.doc, detail=c.detail)
|
yield Completion(
|
||||||
|
c.name,
|
||||||
|
CompletionItemKind.Class,
|
||||||
|
snippet=f"{c.name} {{\n $0\n}}",
|
||||||
|
docs=c.doc,
|
||||||
|
detail=c.detail,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@completer(
|
@completer(
|
||||||
|
@ -118,7 +124,13 @@ def gtk_object_completer(lsp, ast_node, match_variables):
|
||||||
ns = ast_node.root.gir.namespaces.get("Gtk")
|
ns = ast_node.root.gir.namespaces.get("Gtk")
|
||||||
if ns is not None:
|
if ns is not None:
|
||||||
for c in ns.classes.values():
|
for c in ns.classes.values():
|
||||||
yield Completion(c.name, CompletionItemKind.Class, docs=c.doc, detail=c.detail)
|
yield Completion(
|
||||||
|
c.name,
|
||||||
|
CompletionItemKind.Class,
|
||||||
|
snippet=f"{c.name} {{\n $0\n}}",
|
||||||
|
docs=c.doc,
|
||||||
|
detail=c.detail,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@completer(
|
@completer(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue