[add] start symbols
This commit is contained in:
parent
00aed821e1
commit
aede6dab36
3 changed files with 28 additions and 7 deletions
|
@ -14,7 +14,8 @@ declare variable $lsp-text:methods:=map{
|
||||||
|
|
||||||
"textDocument/hover": lsp-text:hover#1,
|
"textDocument/hover": lsp-text:hover#1,
|
||||||
"textDocument/completion": lsp-text:completion#1,
|
"textDocument/completion": lsp-text:completion#1,
|
||||||
"textDocument/formatting" : lsp-text:format#1
|
"textDocument/formatting" : lsp-text:format#1,
|
||||||
|
"textDocument/documentSymbol" : lsp-text:symbols#1
|
||||||
};
|
};
|
||||||
|
|
||||||
(:~ hover :)
|
(:~ hover :)
|
||||||
|
@ -29,6 +30,18 @@ as map(*)
|
||||||
return rpc:result({"contents":$r},$json)
|
return rpc:result({"contents":$r},$json)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
(:~ symbols :)
|
||||||
|
declare
|
||||||
|
function lsp-text:symbols($json as map(*))
|
||||||
|
as map(*)?
|
||||||
|
{
|
||||||
|
let $doc:=$json?params?textDocument?uri
|
||||||
|
return map{
|
||||||
|
"jsonrpc": "2.0",
|
||||||
|
"id": $json?id,
|
||||||
|
"result":()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
declare
|
declare
|
||||||
function lsp-text:completion($json as map(*))
|
function lsp-text:completion($json as map(*))
|
||||||
|
|
|
@ -80,7 +80,7 @@
|
||||||
<button id="wordAt" type="button" class="btn btn-light" title="word at">
|
<button id="wordAt" type="button" class="btn btn-light" title="word at">
|
||||||
<i class="bi bi-1-square"></i></button>
|
<i class="bi bi-1-square"></i></button>
|
||||||
|
|
||||||
<button id="unused2" type="button" class="btn btn-light" title="unused2">
|
<button id="symbols2" type="button" class="btn btn-light" title="symbols">
|
||||||
<i class="bi bi-2-square"></i></button>
|
<i class="bi bi-2-square"></i></button>
|
||||||
|
|
||||||
<button id="unused3" type="button" class="btn btn-light" title="unused3">
|
<button id="unused3" type="button" class="btn btn-light" title="unused3">
|
||||||
|
|
|
@ -43,6 +43,14 @@ $("wordAt").onclick = e => {
|
||||||
alert("wordAt " + JSON.stringify(w));
|
alert("wordAt " + JSON.stringify(w));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$("symbols2").onclick = e => {
|
||||||
|
client.sync();
|
||||||
|
client.request("textDocument/documentSymbol", { "textDocument": { "uri": $("iFile").value} })
|
||||||
|
.then (r => {
|
||||||
|
alert("symbols " + "TODO");
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
$("cmd").onclick = e => {
|
$("cmd").onclick = e => {
|
||||||
let cmds = lsp.listCommands(view);
|
let cmds = lsp.listCommands(view);
|
||||||
[...cmds.keys()].forEach(key => {
|
[...cmds.keys()].forEach(key => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue