Closed drbeco closed 4 months ago
Solutions without quickfix
:
Using bear -- make
to create a compile_commands.json
database into the root of the project (that doesn't use cmake) solves some problems. Now COC can see (almost) all errors using clangd
that gcc
also see. CONS add another file and changes project workflow. The errors.err file is not used, and that is not a good solution here.
Another solution, adding a ~/.config/clangd/config.yaml
general file with some arguments mitigates the problem. CONS it is a general file, and many projects use different arguments.
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:
compile_commands.json
is needed by clangd to work: https://clangd.llvm.org/installation#project-setup.clangd
: https://clangd.llvm.org/config#filescoc.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.
If you have only
coc
to manage lint, it seems thesigncolumn
only shows errors from the coc list, not from the quickfix list.For example, in this image bellow:
>>
Bellow in the image one can read that
int i
andchar 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