Open yuklin opened 2 years ago
I am having an issue on the same line with CoQ and ccls. No issue when using CoQ with other parsers though. Seems to be related to other ccls issues, such as issue #28
I arrived at the same conclusion and until #181 is merged you can try this instead:
use {
"rbjorklin/symbols-outline.nvim",
branch = "fix-outline-detection"
}
I arrived at the same conclusion and until #181 is merged you can try this instead: use { "rbjorklin/symbols-outline.nvim", ...
I tried, but get the same error as before: symbols-outline/parser.lua:254: attempt to index a nil value
My PR was superseded by #183 so do give that a try.
Now I have looked at the source code. There is no check that the value "node.kind" is not equal to nil. That is the cause of the error if it is equal to nil.
I have the same error while using ccls and neovim lsp, I tried #181 and it didn't fix it for me.
Now I have looked at the source code. There is no check that the value "node.kind" is not equal to nil. That is the cause of the error if it is equal to nil.
In fact, different lsp servers return different symbol infomation structures. The symbol information returned from some lsp servers may have no kind
field at all. The code in this project is not rebust enough to handle all the conditions. I think it is necessary to refractor the providers and make sure the symbol info returned from these providers follows a predefined structure (it helps reduce code coupling).
The reason I'm sticking with this project is because the tree structure looks so much better than the alternatives, but if I can't get cpp to work then it's not useful to me :-/
When you change parser.lua
line 254 into
local hl_type = ""
if symbols.kinds[node.kind] ~= nil then
hl_type = config.options.symbols[symbols.kinds[node.kind]].hl
end
then the error is fixed (at least for me).
Thank you! Works like a charm
some thing goes wrong at parser.lua:254
-- local hl_type = config.options.symbols[symbols.kinds[node.kind]].hl local hl_type = config.options.symbols[node.kind].hl
use symbols[node.kind] will be fine?