[PATCH] D74842: [clangd] Make use of syntax tokens in ReplayPreamble
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 4 01:46:21 PST 2020
sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.
================
Comment at: clang-tools-extra/clangd/ParsedAST.cpp:182
+
+ auto IncTok = std::next(HashTok);
+ assert(IncTok != MainFileTokens.end());
----------------
nit: IncludeTok
================
Comment at: clang-tools-extra/clangd/unittests/ParsedASTTests.cpp:384
+
+ auto &P = Points[2 * I];
+ EXPECT_EQ(Inc.HashOffset, P);
----------------
I think it would be clearer to have parallel named point/range lists rather than doing index math.
So the annotated code would be pretty verbose like: `$hash^#$include[[import]] $filerange^"$file[[bar.h]]"...`
But I think the setup/asserts would be clearer.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74842/new/
https://reviews.llvm.org/D74842
More information about the cfe-commits
mailing list