This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Fix the range for include reference to itself.
ClosedPublic

Authored by VitaNuo on Jul 13 2023, 9:26 AM.

Diff Detail

Event Timeline

VitaNuo created this revision.Jul 13 2023, 9:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2023, 9:26 AM
VitaNuo requested review of this revision.Jul 13 2023, 9:26 AM
VitaNuo updated this revision to Diff 540321.Jul 14 2023, 1:45 AM

Re-use the logic from include cleaner in clangd.

kadircet accepted this revision.Jul 14 2023, 3:08 AM
kadircet added inline comments.
clang-tools-extra/clangd/IncludeCleaner.h
87

nit: convention is to use /// for public documentation (as some tools don't export rest for public docs)

89

FWIW, this function has nothing specific about includes. what about renaming it to rangeTillEOL(llvm::StringRef Code, unsigned Offset); // Returns the Range starting at Offset and spanning the whole line. and moving it to SourceCode.h?

This revision is now accepted and ready to land.Jul 14 2023, 3:08 AM
VitaNuo updated this revision to Diff 540385.Jul 14 2023, 5:48 AM

Address comments.

VitaNuo marked 2 inline comments as done.Jul 14 2023, 5:49 AM

Thanks for the comments!

This revision was landed with ongoing or failed builds.Jul 14 2023, 5:51 AM
This revision was automatically updated to reflect the committed changes.