LSP’s floating window (not including the signature help or hover windows) used
for error,warning and info has a single color for the whole text, and you can
customize it using highlighting groups.
The error message contains all sorts of useful information including types, and
I found out with coc.nvim that if I set the color of the text of the error
message to the syntax highlight of that specific programming language it is much
more useful (depending on the error and language used).
coc.nvim has this option, It should be this.
Does the built-in LSP have something similar?
I tried looking at the help and found:
-
vim.lsp.diagnostic.goto_next()
takesopts
,opts.popup_opts
are forwarded to: -
vim.lsp.diagnostic.show_line_diagnostics()
whoseopts
include theopts
for: -
vim.lsp.util.open_floating_preview()
that hassyntax
as its second
argument which is exactly what I want to set. However they are not part of
theopts
argument, they are completely separate.
open_floating_preview({contents}, {syntax}, {opts})
{syntax} string of syntax to set for opened buffer
{opts} dictionary with optional fields
Does this mean it is impossible? Can I customize my config to make it possible?
Should I run back to coc.nvim
?
Any suggestions are greatly appreciated!
Thanks!