[PATCH] D93683: [clangd] Do not take stale definition from the static index.

Aleksandr Platonov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 22 03:30:13 PST 2020


ArcsinX added reviewers: sammccall, kadircet.
ArcsinX added a comment.

I also want to propose the similar patch for fuzzyFind() (as a part of this patch or a separate one), but I faced the following problem:

`Test.cpp`

  #define FOO 1

This example creates empty dynamic index for main file symbols and static index for preamble symbols (`FOO`). The location of `FOO` is inside `Test.cpp`, so (according to the logic that the static index could be stale) we should toss `FOO` from the static index (i.e. preamble symbols), but this behaviour is incorrect... Any advice?



================
Comment at: clang-tools-extra/clangd/index/FileIndex.cpp:434
+      PreambleSymbols.update(
+          *FilePath, std::make_unique<SymbolSlab>(std::move(*IF->Symbols)),
+          std::make_unique<RefSlab>(),
----------------
We do not need this change to fix behaviour for removed definition, but this is the only one place where we use URI instead of path as a key.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93683



More information about the cfe-commits mailing list