Skip to content
This repository was archived by the owner on Aug 16, 2025. It is now read-only.

Conversation

@lambdahands
Copy link

Some language servers (like cssls) don't respond to "textDocument/documentSymbol" with the type DocumentSymbol[], but instead SymbolInformation[].

This is a flat list of symbols in contrast to a hierarchy of symbols with children properties. ​There are other subtle differences, like the lack of a detail field, as well the range living in location.range instead of range. See here in the LSP spec for details about the two types.

This code was put together quickly, so I'm not sure how well it holds up. I found vim.lsp.utils.symbols_to_items(), but it seems to lose name information that's used to build the resulting lines.

Speaking of lines, I ran into a strange issue in which newlines were appearing in the resulting strings, causing nvim_buf_set_lines to fail. Let me know if I'm on the right track here, and thank you for your work on such an awesome plugin!

@lambdahands lambdahands marked this pull request as draft February 1, 2022 23:49
@GustavoKatel
Copy link
Member

hi @lambdahands

I committed your sanitized code here: a562af1

it is now on the dev branch. thanks a lot!

regarding the LSP issue I think it all looks fine. So to merge this PR:

1- can you rebase from dev and use the sanitize code I pushed there?
2- make the PR as "ready for review" when done so I can giver another look :)

thanks!

@GustavoKatel GustavoKatel changed the base branch from main to dev February 13, 2022 19:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants