New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lsp: vim.lsp.diagnostics and lsp-handlers #12655
Conversation
@justinmk when we chatted about this, you menteiond that we alredy have the concept of If I replace |
Maybe. Will look at this now. I also see we have "hooks", at least internally, as implied by This is too many similar-but different concepts. It's unnecessary and puts the work of tying these concepts together on the user (or at least contributors) instead of doing that work in the API design. So a user or plugin author has to internalize
All with semantics that are accidentally different, not essentially different. Just because we didn't do the work of designing a better abstraction. It is easy/fast to add a new "inner platform", but painful for users/contributors, documentation, discussion, debugging, reasoning. |
Yes, I agree with you. I think I do not know what I have a few goals tha I want to accomplish with a PR , some of the more long term. I suppose they don't have to live in core, but some of include:
But maybe it's too late in the day and I'm not making sense. Perhaps one of the |
7d60bd6
to
3a09fae
Compare
What I gathered from our (very productive!) discussion:
|
Note to self: Update docs w/ new signature. |
Note to self: |
ac2af08
to
57e658f
Compare
57e658f
to
04b14db
Compare
|
3cd116a
to
fdefa07
Compare
|
Error using the util endpoint for
|
dce801a
to
99124d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor spelling/language changes to lsp-extensions.txt doc.
e9a814d
to
205d6f1
Compare
mapper( mapper( |
0b92dca
to
515a5b8
Compare
Running |
Its functionality has been merged into Neovim core: neovim/neovim#12655
After neovim/neovim#12655 has been merged, highlights have changed a little, so this commit updates the obsolete highlight groups.
After neovim/neovim#12655 has been merged, highlights have changed a little, so this commit updates the obsolete highlight groups.
I have underline enabled but it doesn't show up. My setting vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {
underline = true,
virtual_text = true,
signs = true,
update_in_insert = true,
}
) |
you should config underline highlight group . |
If you're having issues with this branch, please make an issue on neovim, follow the issue template and then tag me so I can take a look at it there. Thanks. |
It's done. Thank you! function! SetLSPHighlights()
highlight LspDiagnosticsUnderlineError guifg=#EB4917 gui=undercurl
highlight LspDiagnosticsUnderlineWarning guifg=#EBA217 gui=undercurl
highlight LspDiagnosticsUnderlineInformation guifg=#17D6EB, gui=undercurl
highlight LspDiagnosticsUnderlineHint guifg=#17EB7A gui=undercurl
endfunction
autocmd ColorScheme * call SetLSPHighlights() |
After neovim/neovim#12655 has been merged, highlights have changed a little, so this commit updates the obsolete highlight groups.
After neovim/neovim#12655 has been merged, highlights have changed a little, so this commit updates the obsolete highlight groups.
neovim/neovim#12655 made breaking changes renaming highlight groups for LspDiagnostic. It also moved `vim.lsp.callbacks` to `vim.lsp.handlers` Since we're installing the nightly build, we should update this so that a fresh init can work off the bat.
To ensure compatibility with the latest versions of Neovim LSP the highlighting groups for diagnostics have been adapted to the changes of neovim/neovim#12655 [1]. See :help lsp-highlight-diagnostics [2] for more details. Note that LSP will be available as of Neovim 0.5 which is (at the time of this commit) still in development and only available as nighly build. Also see great articles from Nord Vim contributors like "Neovim (0.5) Is Overpowering" [3] for more information about Neovim 0.5 features, including LSP. [1]: neovim/neovim#12655 [2]: https://neovim.io/doc/user/lsp.html [3]: https://crispgm.com/page/neovim-is-overpowering.html Co-authored-by: Sven Greb <development@svengreb.de> Closes GH-229 Closes GH-248
To ensure compatibility with the latest versions of Neovim LSP the highlighting groups for diagnostics have been adapted to the changes of neovim/neovim#12655 [1]. See :help lsp-highlight-diagnostics [2] for more details. Note that LSP will be available as of Neovim 0.5 which is (at the time of this commit) still in development and only available as nighly build. Also see great articles from Nord Vim contributors like "Neovim (0.5) Is Overpowering" [3] for more information about Neovim 0.5 features, including LSP. [1]: neovim/neovim#12655 [2]: https://neovim.io/doc/user/lsp.html [3]: https://crispgm.com/page/neovim-is-overpowering.html Co-authored-by: Sven Greb <development@svengreb.de> Closes nordthemeGH-229 Closes nordthemeGH-248
'LspDiagnosticsDefaultError', | ||
'LspDiagnosticsDefaultHint', | ||
'LspDiagnosticsDefaultInformation', | ||
'LspDiagnosticsDefaultWarning', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: name could be less verbose by omitting "Default", which is largely implied by the nature of builtin highlight groups. We should at least not repeat this pattern in the future.
edit: fixed in #15585 and related PRs.
The naming layout for the diagnostic signs has changed: neovim/neovim#12655
@@ -471,7 +471,7 @@ local function start(cmd, cmd_args, handlers, extra_spawn_params) | |||
local function handle_body(body) | |||
local decoded, err = json_decode(body) | |||
if not decoded then | |||
on_error(client_errors.INVALID_SERVER_JSON, err) | |||
-- on_error(client_errors.INVALID_SERVER_JSON, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tjdevries was this remove intentionally? Not mentioned in the commit message nor PR, afaict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I was having some problems with sumneko locally and I think I commented this out to test something and never uncommented. We can just add this back I'm pretty sure. Sorry about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
np, will do in #15803
PREFACE: Uninstall diagnostic-nvim before updating if you don't want errors. Not much I can do about it if you update them not in sync.
Also, please check the commit message for this PR, as it contains a lot of valuable information for users. You may need to
make distclean; make
when you build the latest master.Configuration Part 1: https://clips.twitch.tv/ZanySincereCookieFeelsBadMan
Virtual Text Configuration: https://clips.twitch.tv/RudeDistinctMuleImGlitch
Show Line Diagnostics: https://clips.twitch.tv/HomelyEnergeticThymePraiseIt
Filtering Diagnostics by Severity: https://clips.twitch.tv/ElatedImpossibleVanillaHeyGirl
Example for Plugin Authors (and @ThePrimeagen) for configuring virtual text diagnostics: https://clips.twitch.tv/PlausibleGleamingWolfImGlitch
( with corresponding gist: https://gist.github.com/tjdevries/ccbe3b79bd918208f2fa8dfe15b95793 )
Original, Very Old PR : #12333
This is only focused on diagnostics. It includes fixes for:
NOTE: You should uninstall diagnostic-nvim if you're using it and follow the guide here: nvim-lua/diagnostic-nvim#73
Highlights
Also note, the highlight group names have changed to now be consistent with each other. From the commit message in neovim core:
inconsistently named.
For example, the highlight that was formerly LspDiagnosticsError is now LspDiagnosticsVirtualTextError. It can also be configured by changing the default highlight group, LspDiagnosticsDefaultError. For more information, read :help lsp-highlight-diagnostics.
Same goes for signs.
The basic layout is:
LspDiagnostics{Name of Thing}{Level}
->LspDiagnosticsSignError
, etc.