autozimu / LanguageClient-neovim

Language Server Protocol (LSP) support for vim and neovim.
MIT License
3.55k stars 273 forks source link

Add support for diagnostics display funcref for more flexible integration #1101

Open martskins opened 4 years ago

martskins commented 4 years ago

This PR provides a config option for a function name to be used as a callback for the publish diagnostics call. What this does is enable us to integrate with external plugins that are used to display diagnostics, such as dense-analysis/ale. The documentation includes an example of how to set that up.

Note that the virtual texts will still be displayed if configured.

Fixes #800 and #852.

martskins commented 4 years ago

This one is a little more involved or disruptive so I'll leave it to you to decide @autozimu, but I think it's a good way to integrate with ale. I think in our case, given that the server publishes the diagnostics when it pleases, we don't need to answer the ALEWantResults autocmd, so this should be enough.