This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Fix the annotate tweak after rL366893
ClosedPublic

Authored by hokein on Jul 24 2019, 7:06 AM.

Details

Summary

After rL366893, the annoate tweak is not activated when we select the
whole file (the commonAncestor is TUDecl but we intend to return null).

This patch fixes this, and also avoid traversing the TUDecl.

Diff Detail

Repository
rL LLVM

Event Timeline

hokein created this revision.Jul 24 2019, 7:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 24 2019, 7:06 AM
sammccall accepted this revision.Jul 24 2019, 7:31 AM
sammccall added inline comments.
clang-tools-extra/clangd/refactor/tweaks/AnnotateHighlightings.cpp
31 ↗(On Diff #211497)

this is now always true. Just return true (maybe with a comment) and move the InterestedDecl stuff to apply?

clang-tools-extra/clangd/unittests/TweakTests.cpp
493 ↗(On Diff #211497)

check input/output for TUDecl since it's a different codepath?

This revision is now accepted and ready to land.Jul 24 2019, 7:31 AM
hokein updated this revision to Diff 211692.Jul 25 2019, 1:46 AM
hokein marked 2 inline comments as done.

Address comments

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 25 2019, 1:47 AM