[PATCH] D45513: [clangd] Add line and column number to the index symbol.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 12 08:26:44 PDT 2018


sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.

LG, with

- consider reverting the bitpacking stuff
- comment about utf-16
- clang-format :)



================
Comment at: clangd/index/SymbolCollector.cpp:202
+    SymbolLocation::Position Pos;
+    // Position is 0-based while source location is 1-based.
+    Pos.Line = SM.getLineNumber(FileId, Offset) - 1;
----------------
nit: SourceManager is 1-based (or returns 1-based data here).
SourceLocation uses 0-based offsets, not 1-based line/column.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D45513





More information about the cfe-commits mailing list