autozimu / LanguageClient-neovim

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

Invert order of diagnostic messages #1184

Closed TheZoq2 closed 3 years ago

TheZoq2 commented 3 years ago

Describe the bug

As of a few versions back, I have started seeing hint messages from rust-analyzer being shown in the language client. While this change is very good, the way they are displayed is a bit annoying as the hints shadow errors and warnings.

For example:

image

The underlying errors here are "missmatched return type" and "this function takes 3 arguments but one was supplied". The last one in particular hides a lot of important information.

In my opinion, it would be much better of the errors and warnings were displayed first if present, and then hints.

Environment

Features: +acl +iconv +tui See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info


- This plugin version (`git rev-parse --short HEAD`):
`8cba87e`
- This plugin's binary version (`bin/languageclient --version`):
`rust-analyzer fde4a86`
- Minimal vimrc content
[min-vimrc.vim] with rls subsituted for rust-analyzer

[min-vimrc.vim]: https://github.com/autozimu/LanguageClient-neovim/blob/next/min-vimrc.vim

## To Reproduce

Open a rust project, cause an error

## Current behavior

If bot hints and errors are present, hint text is displayed inline, rather than the error

## Expected behavior

It would make more sense to me to show diagnostics in severity order

## Additional context

For now, I can set `let g:LanguageClient_diagnosticsMaxSeverity = 'Warning'` to achieve roughly what I want, but then hints are never shown
martskins commented 3 years ago

That has actually been fixed in #1172 but it hasn't been released yet. If you use the dev branch (and build from source) you can get that change into your workflow now, otherwise you'll have to use your workaround until a new release is cut. Shouldn't be too long until a new release, but some important changes have taken place lately and I want to make sure nothing breaks for a few more days.

TheZoq2 commented 3 years ago

Ah awesome, though I think I'm already on the dev branch and it looks like 8cba87e is the latest commit ID on that branch. Maybe I'm missing something though

martskins commented 3 years ago

Have you built the binary from source? make release ?

TheZoq2 commented 3 years ago

Ah, I completely missed having to do that. Looks like it works now :)