This translates diagnostics correctly between 0-based LSP columns, and 1-based clang columns.
Also, use TextEdit as early as possible.
Paths
| Differential D40860
[clangd] Fix diagnostic positions ClosedPublic Authored by rwols on Dec 5 2017, 2:47 PM.
Details Summary This translates diagnostics correctly between 0-based LSP columns, and 1-based clang columns. Also, use TextEdit as early as possible.
Diff Detail
Event TimelineComment Actions Sorry for the delay getting this reviewed.
This revision is now accepted and ready to land.Dec 11 2017, 8:09 AM Comment Actions Hmm, I looked into the empty diagnostic ranges, and it overlaps here a lot. Feel free to go ahead and land this and I can merge, otherwise I can include this fix there.
Comment Actions D41118 adds real (non-empty) ranges for diagnostics. If you like it as-is, probably easiest to land that instead.
Revision Contents
Diff 125621 clang-tools-extra/clangd/ClangdLSPServer.h
clang-tools-extra/clangd/ClangdLSPServer.cpp
clang-tools-extra/clangd/ClangdUnit.h
clang-tools-extra/clangd/ClangdUnit.cpp
clang-tools-extra/test/clangd/diagnostics.test
clang-tools-extra/test/clangd/execute-command.test
clang-tools-extra/test/clangd/extra-flags.test
clang-tools-extra/test/clangd/fixits.test
|
nit: functions are lowerCamelCase.
Here and below.