mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
lsp: Add compile command
Add a custom command to the language server to get the compiled XML from an open blueprint file. Fixes #52.
This commit is contained in:
parent
e3a37893a8
commit
0984e6ecbc
1 changed files with 9 additions and 0 deletions
|
@ -218,6 +218,15 @@ class LanguageServer:
|
||||||
completions = complete(open_file.ast, open_file.tokens, idx)
|
completions = complete(open_file.ast, open_file.tokens, idx)
|
||||||
self._send_response(id, [completion.to_json(True) for completion in completions])
|
self._send_response(id, [completion.to_json(True) for completion in completions])
|
||||||
|
|
||||||
|
@command("textDocument/x-blueprintcompiler-compile")
|
||||||
|
def compile(self, id, params):
|
||||||
|
open_file = self._open_files[params["textDocument"]["uri"]]
|
||||||
|
|
||||||
|
if open_file.ast is None or len(open_file.ast.errors):
|
||||||
|
self._send_response(id, {"xml": None})
|
||||||
|
return
|
||||||
|
|
||||||
|
self._send_response(id, { "xml": open_file.ast.generate() })
|
||||||
|
|
||||||
@command("textDocument/semanticTokens/full")
|
@command("textDocument/semanticTokens/full")
|
||||||
def semantic_tokens(self, id, params):
|
def semantic_tokens(self, id, params):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue