[PATCH] D41118: [clangd] Emit ranges for clangd diagnostics, and fix off-by-one positions

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 13 02:37:06 PST 2017

sammccall added inline comments.

Comment at: test/clangd/diagnostics.test:10
 {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///foo.c","languageId":"c","version":1,"text":"void main() {}"}}}
 #      CHECK:  "method": "textDocument/publishDiagnostics",
hokein wrote:
> Maybe the current tests are enough. Do we want to add a test where the diagnostic location is at the end of the line?
> ```
> f()
> // ^ missing ";"
> f();
> ```
Good point - the current tests only incidentally cover much of the diagnostics functionality.
The lit tests for this are brittle and hard to read, I'll write some gtest cases similar to CodeComplete.

  rCTE Clang Tools Extra


More information about the cfe-commits mailing list