llvm-project/clang-tools-extra/clangd/index
Sam McCall 2cd33e6fe6 [clangd] Track document versions, include them with diags, enhance logs
Summary:
This ties to an LSP feature (diagnostic versioning) but really a lot
of the value is in being able to log what's happening with file versions
and queues more descriptively and clearly.

As such it's fairly invasive, for a logging patch :-\

Key decisions:
 - at the LSP layer, we don't reqire the client to provide versions (LSP
   makes it mandatory but we never enforced it). If not provided,
   versions start at 0 and increment. DraftStore handles this.
 - don't propagate magically using contexts, but rather manually:
   addDocument -> ParseInputs -> (ParsedAST, Preamble, various callbacks)
   Context-propagation would hide the versions from ClangdServer, which
   would make producing good log messages hard
 - within ClangdServer, treat versions as opaque and unordered.
   std::string is a convenient type for this, and allows richer versions
   for embedders. They're "mandatory" but "null" is a reasonable default.

Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D75582
2020-03-05 01:22:32 +01:00
..
dex Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Background.cpp [Support] On Windows, ensure hardware_concurrency() extends to all CPU sockets and all NUMA groups 2020-02-14 10:24:22 -05:00
Background.h [Support] On Windows, ensure hardware_concurrency() extends to all CPU sockets and all NUMA groups 2020-02-14 10:24:22 -05:00
BackgroundIndexLoader.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
BackgroundIndexLoader.h Revert "Revert r366458, r366467 and r366468" 2019-07-19 10:18:52 +00:00
BackgroundIndexStorage.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
BackgroundQueue.cpp [clangd] Show background index status using LSP 3.15 work-done progress notifications 2020-01-24 12:21:08 +01:00
BackgroundRebuild.cpp [clangd] Rename ClangdUnit.h -> ParsedAST.h. NFC 2019-09-04 09:46:06 +00:00
BackgroundRebuild.h [Support] On Windows, ensure hardware_concurrency() extends to all CPU sockets and all NUMA groups 2020-02-14 10:24:22 -05:00
CanonicalIncludes.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
CanonicalIncludes.h [clangd] Use pre-populated mappings for standard symbols 2019-09-09 15:32:51 +00:00
FileIndex.cpp [clangd] Track document versions, include them with diags, enhance logs 2020-03-05 01:22:32 +01:00
FileIndex.h [clangd] Track document versions, include them with diags, enhance logs 2020-03-05 01:22:32 +01:00
Index.cpp [clangd] Add bool return type to Index::refs API. 2019-11-13 14:42:30 +01:00
Index.h [clangd] Add bool return type to Index::refs API. 2019-11-13 14:42:30 +01:00
IndexAction.cpp [clangd] Set RetainCommentsFromSystemHeaders to true 2019-11-07 09:54:20 +01:00
IndexAction.h [clangd] Index API and implementations for relations 2019-06-15 02:26:47 +00:00
MemIndex.cpp [NFC] Fixes -Wrange-loop-analysis warnings 2020-01-01 20:01:37 +01:00
MemIndex.h [clangd] Add bool return type to Index::refs API. 2019-11-13 14:42:30 +01:00
Merge.cpp [clangd] Simplify the code in Index::refs 2019-11-14 14:43:29 +01:00
Merge.h [clangd] Add bool return type to Index::refs API. 2019-11-13 14:42:30 +01:00
Ref.cpp [clangd] Print the Spelled RefKind. 2020-02-13 13:28:11 +01:00
Ref.h [clangd] Add a flag for spelled references in the Index 2020-02-06 08:18:14 +01:00
Relation.cpp [clangd] Use our own relation kind. 2019-10-17 14:08:28 +00:00
Relation.h [clangd] Use our own relation kind. 2019-10-17 14:08:28 +00:00
Serialization.cpp [clangd] Bump index version number. 2020-02-26 13:43:16 +01:00
Serialization.h [clangd] Use our own relation kind. 2019-10-17 14:08:28 +00:00
Symbol.cpp Cleanup: llvm::bsearch -> llvm::partition_point after r364719 2019-06-30 11:19:56 +00:00
Symbol.h NFC: Fix trivial typos in comments 2020-01-04 10:28:41 -05:00
SymbolCollector.cpp [clangd] Set "spelled" flag for constructor references. 2020-02-06 16:59:45 +01:00
SymbolCollector.h [clangd] Add xref for macros to FileIndex. 2020-01-08 08:27:50 +01:00
SymbolID.cpp [clangd] NFC: fix clang-tidy warnings. 2019-01-25 15:14:03 +00:00
SymbolID.h [clangd] Set "spelled" flag for constructor references. 2020-02-06 16:59:45 +01:00
SymbolLocation.cpp Moved SymbolLocation into its own header and implementation file 2019-02-28 11:02:01 +00:00
SymbolLocation.h [clangd] Support utf-8 offsets (rather than utf-16) as a protocol extension 2019-03-27 17:47:49 +00:00
SymbolOrigin.cpp [clangd] Use identifiers in file as completion candidates when build is not ready. 2019-04-11 09:36:36 +00:00
SymbolOrigin.h [clangd] Use identifiers in file as completion candidates when build is not ready. 2019-04-11 09:36:36 +00:00
YAMLSerialization.cpp [clangd] Use our own relation kind. 2019-10-17 14:08:28 +00:00