llvm-project/clang-tools-extra/clangd
Eric Liu 83f63e42b2 [clangd] Support multiple #include headers in one symbol.
Summary:
Currently, a symbol can have only one #include header attached, which
might not work well if the symbol can be imported via different #includes depending
on where it's used. This patch stores multiple #include headers (with # references)
for each symbol, so that CodeCompletion can decide which include to insert.

In this patch, code completion simply picks the most popular include as the default inserted header. We also return all possible includes and their edits in the `CodeCompletion` results.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: mgrang, ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 341304
2018-09-03 10:18:21 +00:00
..
clients/clangd-vscode [clangd] Fix category in clangd-vscode's package.json 2018-07-23 14:32:12 +00:00
fuzzer [clangd] Fix fuzzer build. 2018-08-04 01:51:10 +00:00
global-symbol-builder [clangd] Flatten out Symbol::Details. It was ill-conceived, sorry. 2018-08-31 13:55:01 +00:00
index [clangd] Support multiple #include headers in one symbol. 2018-09-03 10:18:21 +00:00
tool [clangd] Implement findOccurrences interface in dynamic index. 2018-08-31 19:53:37 +00:00
AST.cpp [clangd] Share getSymbolID implementation. 2018-08-07 08:57:52 +00:00
AST.h [clangd] Share getSymbolID implementation. 2018-08-07 08:57:52 +00:00
CMakeLists.txt [clangd] Initial cancellation mechanism for LSP requests. 2018-08-24 13:09:41 +00:00
Cancellation.cpp [clangd] Initial cancellation mechanism for LSP requests. 2018-08-24 13:09:41 +00:00
Cancellation.h [clangd] Initial cancellation mechanism for LSP requests. 2018-08-24 13:09:41 +00:00
ClangdLSPServer.cpp [clangd] Initial cancellation mechanism for LSP requests. 2018-08-24 13:09:41 +00:00
ClangdLSPServer.h [clangd] Initial cancellation mechanism for LSP requests. 2018-08-24 13:09:41 +00:00
ClangdServer.cpp [clangd] Run SignatureHelp using an up-to-date preamble, waiting if needed. 2018-08-30 15:07:34 +00:00
ClangdServer.h [clangd] Initial cancellation mechanism for LSP requests. 2018-08-24 13:09:41 +00:00
ClangdUnit.cpp NFC: Enforce good formatting across multiple clang-tools-extra files 2018-08-14 16:03:32 +00:00
ClangdUnit.h NFC: Enforce good formatting across multiple clang-tools-extra files 2018-08-14 16:03:32 +00:00
CodeComplete.cpp [clangd] Support multiple #include headers in one symbol. 2018-09-03 10:18:21 +00:00
CodeComplete.h [clangd] Support multiple #include headers in one symbol. 2018-09-03 10:18:21 +00:00
CodeCompletionStrings.cpp [clangd] Show function documentation in signature help 2018-08-17 09:29:38 +00:00
CodeCompletionStrings.h [clangd] Show function documentation in signature help 2018-08-17 09:29:38 +00:00
Compiler.cpp NFC: Enforce good formatting across multiple clang-tools-extra files 2018-08-14 16:03:32 +00:00
Compiler.h NFC: Enforce good formatting across multiple clang-tools-extra files 2018-08-14 16:03:32 +00:00
Context.cpp NFC: Enforce good formatting across multiple clang-tools-extra files 2018-08-14 16:03:32 +00:00
Context.h [clangd] context key constructor is constexpr. NFC 2018-06-15 12:39:21 +00:00
Diagnostics.cpp [clangd] add an extension field to LSP to transfer the diagnostic's category 2018-08-14 22:21:40 +00:00
Diagnostics.h [clangd] send diagnostic categories only when 'categorySupport' 2018-08-22 20:30:06 +00:00
DraftStore.cpp [clangd] Support incremental document syncing 2018-03-26 14:41:40 +00:00
DraftStore.h [clangd] Support incremental document syncing 2018-03-26 14:41:40 +00:00
FSProvider.h [clangd] Extract FileSystemProvider into a separate header. NFC 2018-07-12 14:49:52 +00:00
FileDistance.cpp NFC: Fix build failure after rL341182 2018-08-31 08:29:48 +00:00
FileDistance.h [NFC] Use LLVM naming conventions within FileDistance 2018-08-31 08:19:50 +00:00
FindSymbols.cpp [clangd] Avoid duplicates in findDefinitions response 2018-08-10 22:27:53 +00:00
FindSymbols.h [clangd] Correct the namespace of ParsedAST forward declaration, NFC. 2018-08-01 12:50:44 +00:00
Function.h [clangd] Replace UniqueFunction with llvm::unique_function. 2018-07-03 20:59:33 +00:00
FuzzyMatch.cpp [clangd] FuzzyMatch exposes an API for its word segmentation. NFC 2018-07-20 08:01:37 +00:00
FuzzyMatch.h [clangd] FuzzyMatch exposes an API for its word segmentation. NFC 2018-07-20 08:01:37 +00:00
GlobalCompilationDatabase.cpp NFC: Enforce good formatting across multiple clang-tools-extra files 2018-08-14 16:03:32 +00:00
GlobalCompilationDatabase.h NFC: Enforce good formatting across multiple clang-tools-extra files 2018-08-14 16:03:32 +00:00
Headers.cpp [clangd] Incorporate transitive #includes into code complete proximity scoring. 2018-07-03 08:09:29 +00:00
Headers.h [clangd] Incorporate transitive #includes into code complete proximity scoring. 2018-07-03 08:09:29 +00:00
JSONRPCDispatcher.cpp [clangd] Initial cancellation mechanism for LSP requests. 2018-08-24 13:09:41 +00:00
JSONRPCDispatcher.h [clangd] Initial cancellation mechanism for LSP requests. 2018-08-24 13:09:41 +00:00
Logger.cpp [clangd] Upgrade logging facilities with levels and formatv. 2018-07-11 10:35:11 +00:00
Logger.h [clangd] Fix many typos. NFC 2018-09-01 07:47:03 +00:00
Path.h Restored r303067 and fixed failing test. 2017-05-16 09:38:59 +00:00
Protocol.cpp [clangd] Initial cancellation mechanism for LSP requests. 2018-08-24 13:09:41 +00:00
Protocol.h [clangd] Report position of opening paren in singature help 2018-08-30 13:14:31 +00:00
ProtocolHandlers.cpp [clangd] Initial cancellation mechanism for LSP requests. 2018-08-24 13:09:41 +00:00
ProtocolHandlers.h [clangd] Initial cancellation mechanism for LSP requests. 2018-08-24 13:09:41 +00:00
Quality.cpp NFC: Enforce good formatting across multiple clang-tools-extra files 2018-08-14 16:03:32 +00:00
Quality.h NFC: Enforce good formatting across multiple clang-tools-extra files 2018-08-14 16:03:32 +00:00
SourceCode.cpp [clangd] Support textEdit in addition to insertText. 2018-08-13 08:23:01 +00:00
SourceCode.h [clangd] Support textEdit in addition to insertText. 2018-08-13 08:23:01 +00:00
TUScheduler.cpp [clangd] Run SignatureHelp using an up-to-date preamble, waiting if needed. 2018-08-30 15:07:34 +00:00
TUScheduler.h [clangd] Run SignatureHelp using an up-to-date preamble, waiting if needed. 2018-08-30 15:07:34 +00:00
Threading.cpp [clangd] Use 'const Twine&' instead of 'Twine'. NFC 2018-07-26 16:13:52 +00:00
Threading.h [clangd] Use 'const Twine&' instead of 'Twine'. NFC 2018-07-26 16:13:52 +00:00
Trace.cpp [clangd] Remove JSON library in favor of llvm/Support/JSON 2018-07-09 14:25:59 +00:00
Trace.h [clangd] Remove JSON library in favor of llvm/Support/JSON 2018-07-09 14:25:59 +00:00
URI.cpp [clangd] Allow using customized include path in URI. 2018-04-09 15:09:44 +00:00
URI.h [clangd] clang-format the source code. NFC 2018-05-30 12:41:19 +00:00
XRefs.cpp [clangd] Remove unused parameter. NFC 2018-08-28 11:04:07 +00:00
XRefs.h NFC: Enforce good formatting across multiple clang-tools-extra files 2018-08-14 16:03:32 +00:00