[add] start symbols

This commit is contained in:
Andy Bunce 2025-09-20 22:18:15 +01:00
parent 00aed821e1
commit aede6dab36
3 changed files with 28 additions and 7 deletions

View file

@ -80,7 +80,7 @@
<button id="wordAt" type="button" class="btn btn-light" title="word at">
<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>
<button id="unused3" type="button" class="btn btn-light" title="unused3">

View file

@ -38,17 +38,25 @@ $("search").onclick = e => lsp.openSearchPanel(view);
$("fullscreen").onclick = e => $("editor").requestFullscreen();
$("wordAt").onclick = e => {
let pos=view.state.selection.main.head;
let w= view.state.wordAt(pos);
alert("wordAt " + JSON.stringify(w) );
let pos = view.state.selection.main.head;
let w = view.state.wordAt(pos);
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 => {
let cmds = lsp.listCommands(view);
[...cmds.keys()].forEach(key => {
console.log(`${key} ${cmds.get(key).key}` )
console.log(`${key} ${cmds.get(key).key}`)
});
};
$("lint").onclick = async e => {