autozimu / LanguageClient-neovim

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

Use LCN defined highlights and introduce CodeLensDisplay config #1144

Closed martskins closed 3 years ago

martskins commented 3 years ago

This PR defines highlight groups for diagnostics display instead of relying on the ones defined by ALE being available. This fixes the default config for vim8 users that don't use ale, as using an undefined highlight group in vim results in an error (it doesn't in neovim).

It also creates a new struct CodeLensDisplay to be used to control how code lenses are displayed so that both code lenses and diagnostics are configured in a similar fashion. Right now, the CodeLensDisplay struct only takes the virtual_texthl, but eventually my plan is to add support for signs for code lenses, so that vim8 users can know that there is a code lens in that line, as right now they can't because of the lack of virtual texts in vim8.

Note that this introduces a minor breaking change, as the config for controlling code lens highlight group has been changed, but it is a non-critical break and the client will continue to work normally except that it will not display the expected highlight group, and also that config is rather new so probably not so many users are aware of it, so I think we should merge as is.