mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Merge branch 'main' of https://gitlab.gnome.org/jwestman/blueprint-compiler into formatter
This commit is contained in:
commit
4f5c1537dd
15 changed files with 76 additions and 33 deletions
|
@ -117,6 +117,7 @@ class LanguageServer:
|
|||
|
||||
def __init__(self):
|
||||
self.client_capabilities = {}
|
||||
self.client_supports_completion_choice = False
|
||||
self._open_files: T.Dict[str, OpenFile] = {}
|
||||
|
||||
def run(self):
|
||||
|
@ -189,6 +190,9 @@ class LanguageServer:
|
|||
from . import main
|
||||
|
||||
self.client_capabilities = params.get("capabilities", {})
|
||||
self.client_supports_completion_choice = params.get("clientInfo", {}).get(
|
||||
"name"
|
||||
) in ["Visual Studio Code", "VSCodium"]
|
||||
self._send_response(
|
||||
id,
|
||||
{
|
||||
|
@ -273,7 +277,7 @@ class LanguageServer:
|
|||
idx = utils.pos_to_idx(
|
||||
params["position"]["line"], params["position"]["character"], open_file.text
|
||||
)
|
||||
completions = complete(open_file.ast, open_file.tokens, idx)
|
||||
completions = complete(self, open_file.ast, open_file.tokens, idx)
|
||||
self._send_response(
|
||||
id, [completion.to_json(True) for completion in completions]
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue