Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Support for other LSP plugins #25

Closed
Shatur opened this issue May 4, 2020 · 4 comments
Closed

Support for other LSP plugins #25

Shatur opened this issue May 4, 2020 · 4 comments

Comments

@Shatur
Copy link

Shatur commented May 4, 2020

Thank you for the plugin! Is it possible to integrate with other LSP plugins? For example, I recently switched to vim-lamp. Can I somehow configure it to make it work with your plugin?

@jackguo380
Copy link
Owner

jackguo380 commented May 6, 2020

Hi Shatur95,

I had a look into vim-lamp and it looks like it doesn't provide any method for a third party plugin to receive notifications as seen here.

In order for vim-lsp-cxx-highlight to work vim-lamp will need to provide some kind of API, could you open a issue on vim-lamp to request this functionality and tag me?

For example the API used to register for notifications on vim-lsp is this, and on LanguageClient-neovim it is this.

Edit:
I just saw hrsh7th/vim-lamp#15. Are you looking for semantic highlighting using clangd or ccls? If its clangd there's a lot of extra work that vim-lamp needs to do to get it working due to the weird protocol. See the discussion on #14.

@Shatur
Copy link
Author

Shatur commented May 6, 2020

Thanks for explanations! I trying to get semantic highlighting from Clang. If I understand correctly, there is sementicHighlights (unofficial spec) and semanticTokens (official candidate). vim-lamp have plans to implement the last one (semanticTokens support was added recently to clangd: llvm/llvm-project@71177ac#diff-bc83abf3e556418f438c09a672856449). Is this plugin trying to provide semanticHighlights? So, is vim-lamp need to have additional support to make your plugin to work?

@jackguo380
Copy link
Owner

This plugin implements neither of those two proposed standards. The primary purpose of this plugin is to provide semantic highlighting for cquery and ccls. Both of these language servers implement non-standard protocols for semantic highlighting.

clangd support was later added for people using coc.nvim by coc-clangd. Note that it is actually coc-clangd which implements the old proposed standard for semantic highlighting and converts it to stuff vim-lsp-cxx-highlight understands. As a result vim-lsp-cxx-highlight won't work with clangd unless coc.nvim and coc-clangd are in the middle to do this conversion.

Essentially if vim-lamp wants to use vim-lsp-cxx-highlight as its highlighting backend then vim-lamp needs to perform the conversion of clangd's messages and then call the right functions in vim-lsp-cxx-highlight. This is actually quite non-trivial to do in vimscript due to the fact that the old standard uses binary encoded data in its messages. There would be a lot of work for vim-lamp to implement a standard which is already going out the door and as far as I know is only implemented by clangd and eclipse.jdt.ls. Probably best to wait for semanticTokens to land in clangd, I'm assuming it might be ready by LLVM 11 or 12.

@Shatur
Copy link
Author

Shatur commented May 8, 2020

Thank you a lot for explanations!
Will wait for semanticTokens :)

@Shatur Shatur closed this as completed May 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants