neo-tree.nvim
neo-tree.nvim copied to clipboard
BUG: Document Symbol source break in some special LS.
Did you check docs and existing issues?
- [X] I have read all the docs.
- [X] I have searched the existing issues.
- [X] I have searched the existing discussions.
Neovim Version (nvim -v)
NVIM v0.10.0-dev
Operating System / Version
wsl2 ubuntu-22.04
Describe the Bug
The textDocument/documentSymbol response for bashls is a bit different from the other LS, and thus fails when parsing the symbol tree. For this reason, I compared the results of several ls responses
bashls:
result = {
{
kind = 12,
location = {
range = {
["end"] = {
character = 1,
line = 45
},
start = {
character = 0,
line = 0
}
},
uri = "file:///home/ngpong/azerothcore-wotlk/apps/installer/includes/functions.sh"
},
name = "inst_configureOS"
}
}
jsonls
result = {
{
children = {},
detail = "azerothcore-wotlk",
kind = 15,
name = "name",
range = {
["end"] = {
character = 29,
line = 1
},
start = {
character = 2,
line = 1
}
},
selectionRange = {
["end"] = {
character = 8,
line = 1
},
start = {
character = 2,
line = 1
}
}
}
}
clangd
result = {
{
kind = 13,
name = "using namespace boost::program_options",
range = {
["end"] = {
character = 38,
line = 38
},
start = {
character = 0,
line = 38
}
},
selectionRange = {
["end"] = {
character = 38,
line = 38
},
start = {
character = 23,
line = 38
}
}
}
}
I'm not quite sure if this response from bashls is in line with the specification, and I'm sorry to say that I'm still very new to this area. But the key point is that I've seen approaches for this kind of differential handling elsewhere, e.g. nvim-navic, so maybe we should do the same, am I right?
Screenshots, Traceback
No response
Steps to Reproduce
- install bashls.
- open neotree and navigate to the Document Symbols source.
Expected Behavior
can open the document symbol source
Your Configuration
I would contend that if bashls is not conforming to the LSP specification that an issue should be raised with them instead of here.
I don't actually know if that is the case but my assumption (correct me if I am wrong @pysan3 ) is that the Document Source is operating against the known LSP specification
A side note: I am able to recreate this issue
Unfortunately, I also have no knowledge about lsp and doc symbols. I hope @nhat-vo can help us out.
nvim-navic seems to first search for symbol.location.range [ref] and then overwrite the reference with symbol.range [ref] afterwards to handle this issue.
I apologize I thought you were the one that created this source 😂 my bad!