This is an archive of the discontinued LLVM Phabricator instance.

Improve diagnostics range reporting.
ClosedPublic

Authored by kadircet on Sep 26 2018, 5:16 AM.

Details

Summary

If we have some range information coming from clang diagnostic, promote
that one even if it doesn't contain diagnostic location inside.

Diff Detail

Repository
rL LLVM

Event Timeline

kadircet created this revision.Sep 26 2018, 5:16 AM
ioeric accepted this revision.Sep 27 2018, 1:35 AM
ioeric added inline comments.
clangd/Diagnostics.cpp
55 ↗(On Diff #167111)

nit: Maybe FallbackRange?

unittests/clangd/ClangdUnitTests.cpp
82 ↗(On Diff #167111)

What is this //with comments for? Maybe explain it in the comment if it does something?

This revision is now accepted and ready to land.Sep 27 2018, 1:35 AM
kadircet updated this revision to Diff 167283.Sep 27 2018, 5:03 AM
kadircet marked 2 inline comments as done.
  • Address comments.
unittests/clangd/ClangdUnitTests.cpp
82 ↗(On Diff #167111)

In the previous implementation we were highlighting the "//with comments" as it was the token at that location. But since this is an insertion and we are not going to replace that token it seemed confusing to highlight all the comment.

This revision was automatically updated to reflect the committed changes.