update tcl standard
This commit is contained in:
@@ -1,10 +1,25 @@
|
||||
{
|
||||
"tcl": [
|
||||
"proc",
|
||||
"puts",
|
||||
"if",
|
||||
"else",
|
||||
"elseif"
|
||||
{
|
||||
"label": "proc",
|
||||
"kind": "keyword"
|
||||
},
|
||||
{
|
||||
"label": "if",
|
||||
"kind": "keyword"
|
||||
},
|
||||
{
|
||||
"label": "else",
|
||||
"kind": "keyword"
|
||||
},
|
||||
{
|
||||
"label": "elseif",
|
||||
"kind": "keyword"
|
||||
},
|
||||
{
|
||||
"label": "puts",
|
||||
"kind": "function"
|
||||
}
|
||||
],
|
||||
"MOM_procs": [
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@ KIND_MAP = {
|
||||
"field": lsp.CompletionItemKind.Field,
|
||||
"module": lsp.CompletionItemKind.Module,
|
||||
"namespace": lsp.CompletionItemKind.Class,
|
||||
"keyword": lsp.CompletionItemKind.Keyword,
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +42,10 @@ class StandardCompletionItems:
|
||||
items = []
|
||||
for i in data.get("tcl", []):
|
||||
items.append(
|
||||
lsp.CompletionItem(label=i, kind=lsp.CompletionItemKind.Keyword)
|
||||
lsp.CompletionItem(
|
||||
label=i.get("label", ""),
|
||||
kind=KIND_MAP.get(i.get("kind", ""), lsp.CompletionItemKind.Text),
|
||||
)
|
||||
)
|
||||
return items
|
||||
|
||||
|
||||
@@ -74,13 +74,13 @@ TOOL_ARGS = [] # default arguments always passed to your tool.
|
||||
@LSP_SERVER.feature(lsp.TEXT_DOCUMENT_DID_OPEN)
|
||||
def did_open(params: lsp.DidOpenTextDocumentParams) -> None:
|
||||
"""LSP handler for textDocument/didOpen request."""
|
||||
document = LSP_SERVER.workspace.get_document(params.text_document.uri)
|
||||
document = LSP_SERVER.workspace.get_text_document(params.text_document.uri)
|
||||
|
||||
|
||||
@LSP_SERVER.feature(lsp.TEXT_DOCUMENT_DID_SAVE)
|
||||
def did_save(params: lsp.DidSaveTextDocumentParams) -> None:
|
||||
"""LSP handler for textDocument/didSave request."""
|
||||
document = LSP_SERVER.workspace.get_document(params.text_document.uri)
|
||||
document = LSP_SERVER.workspace.get_text_document(params.text_document.uri)
|
||||
|
||||
|
||||
@LSP_SERVER.feature(lsp.TEXT_DOCUMENT_DID_CLOSE)
|
||||
|
||||
Reference in New Issue
Block a user