Nathan Ridge

Results 1499 comments of Nathan Ridge

> But it only shows the errors, how can it give me warnings like editor do? ![image](https://user-images.githubusercontent.com/46550268/226888258-e6400102-68ac-4f1c-b10d-12e8316b1620.png) Unfortunately this is not currently supported, but we have https://github.com/clangd/clangd/issues/1447 open for adding...

> I found a workaround that adding `WarningsAsErrors` and `-WFlag` to config file to enable clang-tidy and compiler waring/errors in clangd `--Check` mode, but the diagnostics of `unused include` specified...

The diagnostic is coming from the preamble --> this is an artifact of clangd's preamble optimization. Clangd is basically processing the file in two steps that are roughly equivalent to:...

@pkradiator could you attach a [clangd log](https://clangd.llvm.org/troubleshooting.html#gathering-logs) from a session where you perform this completion?

Yeah, in the log I am seeing: ``` "insertText": "include \"$0\"" ``` So clangd is correctly indicating that the cursor should go inside the quotes (`$0` indicates the cursor position)....

Agreed, this is important context for understanding a diagnostic. I would expect clangd to produce a "note" of the form "In file included from ``" for every element of the...

(Transferred to the clangd repo as the issue is on the server side. The `textDocument/publishDiagnostics` notification does not currently contain information about the intermediate elements of the include chain.)

Some notes on this for future reference: * The logic for printing the include chain is found in the compiler frontend's `DiagnosticConsumer` implementation (`clang::TextDiagnosticPrinter`) * More specifically, this is implemented...

As discussed at https://clangd.llvm.org/troubleshooting.html#gathering-logs, this can be done by adding `--log=verbose` to `"clangd.arguments"`.

> the vscode language client libraries support a setting like `clangd.trace.server` out of the box. Do you know how this works at the protocol level?