[PATCH] D97535: [clangd] Use URIs instead of paths in the index file list

Aleksandr Platonov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 26 01:06:48 PST 2021


ArcsinX created this revision.
Herald added subscribers: usaxena95, kadircet, arphaman.
ArcsinX requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.
Herald added a project: clang.

Without this patch the file list of the index is derived from the keys, but initial `FileSymbols` design was that the keys are arbitrary, so we can not assume that the keys are always paths/URIs (e.g. the preamble index uses URIs for the keys and other indexes use file paths).
This patch introduces the file list extraction from the index data, thus it makes `FileSymbols` usage more flexible (we do not need to think about the keys) and helps to avoid a lot of URI <=> path conversions, but from the other hand the index file list could be empty if there are no symbols/references (empty files seems to be a very rare case).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97535

Files:
  clang-tools-extra/clangd/index/FileIndex.cpp
  clang-tools-extra/clangd/index/MemIndex.cpp
  clang-tools-extra/clangd/index/dex/Dex.cpp
  clang-tools-extra/clangd/unittests/DexTests.cpp
  clang-tools-extra/clangd/unittests/IndexTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97535.326622.patch
Type: text/x-patch
Size: 6594 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210226/0bbbc2a6/attachment.bin>


More information about the cfe-commits mailing list