[all-commits] [llvm/llvm-project] e35f92: [clangd] Ignore the static index refs from the dyn...

Aleksandr Platonov via All-commits all-commits at lists.llvm.org
Fri Dec 18 04:37:35 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e35f9229dcb264be4a0a1ecf5cca2493f2c48878
      https://github.com/llvm/llvm-project/commit/e35f9229dcb264be4a0a1ecf5cca2493f2c48878
  Author: Aleksandr Platonov <platonov.aleksandr at huawei.com>
  Date:   2020-12-18 (Fri, 18 Dec 2020)

  Changed paths:
    M clang-tools-extra/clangd/index/FileIndex.cpp
    M clang-tools-extra/clangd/index/Index.cpp
    M clang-tools-extra/clangd/index/Index.h
    M clang-tools-extra/clangd/index/MemIndex.cpp
    M clang-tools-extra/clangd/index/MemIndex.h
    M clang-tools-extra/clangd/index/Merge.cpp
    M clang-tools-extra/clangd/index/Merge.h
    M clang-tools-extra/clangd/index/ProjectAware.cpp
    M clang-tools-extra/clangd/index/dex/Dex.cpp
    M clang-tools-extra/clangd/index/dex/Dex.h
    M clang-tools-extra/clangd/index/remote/Client.cpp
    M clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
    M clang-tools-extra/clangd/unittests/DexTests.cpp
    M clang-tools-extra/clangd/unittests/IndexTests.cpp
    M clang-tools-extra/clangd/unittests/RenameTests.cpp
    M clang-tools-extra/clangd/unittests/TestFS.cpp

  Log Message:
  -----------
  [clangd] Ignore the static index refs from the dynamic index files.

This patch fixes the following problem:
- open a file with references to the symbol `Foo`
- remove all references to `Foo` (from the dynamic index).
- `MergedIndex::refs()` result will contain positions of removed references (from the static index).

The idea of this patch is to keep a set of files which were used during index build inside the index.
Thus at processing the static index references we can check if the file of processing reference is a part of the dynamic index or not.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D93393




More information about the All-commits mailing list