[PATCH] D155215: [clangd] Fix the range for include reference to itself.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 14 03:08:54 PDT 2023


kadircet accepted this revision.
kadircet added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang-tools-extra/clangd/IncludeCleaner.h:87
+
+// Returns the range starting at '#' and ending at EOL. Escaped newlines are not
+// handled.
----------------
nit: convention is to use `///` for public documentation (as some tools don't export rest for public docs)


================
Comment at: clang-tools-extra/clangd/IncludeCleaner.h:89
+// handled.
+clangd::Range getIncludeRange(llvm::StringRef Code, unsigned HashOffset);
 } // namespace clangd
----------------
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`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155215/new/

https://reviews.llvm.org/D155215



More information about the cfe-commits mailing list