neoclide / coc.nvim

Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
Other
24.16k stars 954 forks source link

Show errors from quickfix #4891

Closed drbeco closed 4 months ago

drbeco commented 5 months ago

If you have only coc to manage lint, it seems the signcolumn only shows errors from the coc list, not from the quickfix list.

For example, in this image bellow:

Screenshot_20240212_221153

Bellow in the image one can read that int i and char s[SBUFF] got an warning for never being used, in the quickfix window.

Also, if I move from error to error with COC shortcuts, it does not stops at those lines 56 and 57.

If I move with unimpaired [q and ]q shortcuts, on the other hand, it stops ONLY on the quickfix errors, and not on lines from COC / lint errors.

I wonder if we can unify this and make it a single list of errors, so the shortcuts and the signcolumn works.

Thanks

drbeco commented 5 months ago
drbeco commented 5 months ago

Solutions without quickfix:

fannheyward commented 4 months ago

coc.nvim displayed the errors from language server, for example clangd, LS reports the error with location and coc.nvim displayed them with signcolumn and highlighting.

Here, clangd reported L37 error, didn't report L57 as an error, coc.nvim only displayed L37 error.

For your solutions:

  1. compile_commands.json is needed by clangd to work: https://clangd.llvm.org/installation#project-setup
  2. clangd supports project configuration .clangd: https://clangd.llvm.org/config#files
fannheyward commented 4 months ago

coc.nvim is an LSP client, this means what coc.nvim can do is depended on language server, the client requests from server for completion/diagnostics/formatting etc, handles what server responses and applies to vim buffer.

Back to your question, what you want is: make coc.nvim displays errors from clangd and errors.err both. Have no idea how to archive this, and it's not coc.nvim's mission target/task.