2017-05-23 18:17:48 +08:00
|
|
|
set(LLVM_LINK_COMPONENTS
|
|
|
|
Support
|
|
|
|
)
|
|
|
|
|
2018-04-03 17:40:07 +08:00
|
|
|
set(CLANGD_ATOMIC_LIB "")
|
|
|
|
if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
|
|
|
|
list(APPEND CLANGD_ATOMIC_LIB "atomic")
|
|
|
|
endif()
|
|
|
|
|
2017-05-23 16:12:45 +08:00
|
|
|
add_clang_library(clangDaemon
|
2018-03-09 22:00:34 +08:00
|
|
|
AST.cpp
|
2017-05-16 17:38:59 +08:00
|
|
|
ClangdLSPServer.cpp
|
|
|
|
ClangdServer.cpp
|
|
|
|
ClangdUnit.cpp
|
2017-12-04 21:49:59 +08:00
|
|
|
CodeComplete.cpp
|
2017-12-21 01:24:31 +08:00
|
|
|
CodeCompletionStrings.cpp
|
2017-12-04 21:49:59 +08:00
|
|
|
Compiler.cpp
|
2018-01-25 22:19:21 +08:00
|
|
|
Context.cpp
|
2018-03-12 23:28:22 +08:00
|
|
|
Diagnostics.cpp
|
2017-05-16 17:38:59 +08:00
|
|
|
DraftStore.cpp
|
[clangd] Implementation of workspace/symbol request
Summary:
This is a basic implementation of the "workspace/symbol" request which is
used to find symbols by a string query. Since this is similar to code completion
in terms of result, this implementation reuses the "fuzzyFind" in order to get
matches. For now, the scoring algorithm is the same as code completion and
improvements could be done in the future.
The index model doesn't contain quite enough symbols for this to cover
common symbols like methods, enum class enumerators, functions in unamed
namespaces, etc. The index model will be augmented separately to achieve this.
Reviewers: sammccall, ilya-biryukov
Reviewed By: sammccall
Subscribers: jkorous, hokein, simark, sammccall, klimek, mgorny, ilya-biryukov, mgrang, jkorous-apple, ioeric, MaskRay, cfe-commits
Differential Revision: https://reviews.llvm.org/D44882
llvm-svn: 330637
2018-04-24 04:00:52 +08:00
|
|
|
FindSymbols.cpp
|
2018-07-03 16:09:29 +08:00
|
|
|
FileDistance.cpp
|
2017-12-02 01:08:02 +08:00
|
|
|
FuzzyMatch.cpp
|
2017-05-16 17:38:59 +08:00
|
|
|
GlobalCompilationDatabase.cpp
|
2018-02-16 22:15:55 +08:00
|
|
|
Headers.cpp
|
2017-11-24 21:13:41 +08:00
|
|
|
JSONRPCDispatcher.cpp
|
2017-09-20 15:24:15 +08:00
|
|
|
Logger.cpp
|
2017-02-07 18:28:20 +08:00
|
|
|
Protocol.cpp
|
|
|
|
ProtocolHandlers.cpp
|
[clangd] Extract scoring/ranking logic, and shave yaks.
Summary:
Code completion scoring was embedded in CodeComplete.cpp, which is bad:
- awkward to test. The mechanisms (extracting info from index/sema) can be
unit-tested well, the policy (scoring) should be quantitatively measured.
Neither was easily possible, and debugging was hard.
The intermediate signal struct makes this easier.
- hard to reuse. This is a bug in workspaceSymbols: it just presents the
results in the index order, which is not sorted in practice, it needs to rank
them!
Also, index implementations care about scoring (both query-dependent and
independent) in order to truncate result lists appropriately.
The main yak shaved here is the build() function that had 3 variants across
unit tests is unified in TestTU.h (rather than adding a 4th variant).
Reviewers: ilya-biryukov
Subscribers: klimek, mgorny, ioeric, MaskRay, jkorous, mgrang, cfe-commits
Differential Revision: https://reviews.llvm.org/D46524
llvm-svn: 332378
2018-05-16 01:43:27 +08:00
|
|
|
Quality.cpp
|
2017-12-19 20:23:48 +08:00
|
|
|
SourceCode.cpp
|
2018-01-31 16:51:16 +08:00
|
|
|
Threading.cpp
|
2017-11-02 17:21:51 +08:00
|
|
|
Trace.cpp
|
2018-01-31 16:51:16 +08:00
|
|
|
TUScheduler.cpp
|
2018-01-22 19:48:20 +08:00
|
|
|
URI.cpp
|
2017-12-20 01:06:07 +08:00
|
|
|
XRefs.cpp
|
[clangd] Introduce Dex symbol index search tokens
This patch introduces the core building block of the next-generation
Clangd symbol index - Dex. Search tokens are the keys in the inverted
index and represent a characteristic of a specific symbol: examples of
search token types (Token Namespaces) are
* Trigrams - these are essential for unqualified symbol name fuzzy
search * Scopes for filtering the symbols by the namespace * Paths, e.g.
these can be used to uprank symbols defined close to the edited file
This patch outlines the generic for such token namespaces, but only
implements trigram generation.
The intuition behind trigram generation algorithm is that each extracted
trigram is a valid sequence for Fuzzy Matcher jumps, proposed
implementation utilize existing FuzzyMatcher API for segmentation and
trigram extraction.
However, trigrams generation algorithm for the query string is different
from the previous one: it simply yields sequences of 3 consecutive
lowercased valid characters (letters, digits).
Dex RFC in the mailing list:
http://lists.llvm.org/pipermail/clangd-dev/2018-July/000022.html
The trigram generation techniques are described in detail in the
proposal:
https://docs.google.com/document/d/1C-A6PGT6TynyaX4PXyExNMiGmJ2jL1UwV91Kyx11gOI/edit#heading=h.903u1zon9nkj
Reviewers: sammccall, ioeric, ilya-biryukovA
Subscribers: cfe-commits, klimek, mgorny, MaskRay, jkorous, arphaman
Differential Revision: https://reviews.llvm.org/D49591
llvm-svn: 337901
2018-07-25 18:34:57 +08:00
|
|
|
|
2018-02-16 22:15:55 +08:00
|
|
|
index/CanonicalIncludes.cpp
|
2017-12-15 20:25:02 +08:00
|
|
|
index/FileIndex.cpp
|
[clangd] Introduce a "Symbol" class.
Summary:
* The "Symbol" class represents a C++ symbol in the codebase, containing all the
information of a C++ symbol needed by clangd. clangd will use it in clangd's
AST/dynamic index and global/static index (code completion and code
navigation).
* The SymbolCollector (another IndexAction) will be used to recollect the
symbols when the source file is changed (for ASTIndex), or to generate
all C++ symbols for the whole project.
In the long term (when index-while-building is ready), clangd should share a
same "Symbol" structure and IndexAction with index-while-building, but
for now we want to have some stuff working in clangd.
Reviewers: ioeric, sammccall, ilya-biryukov, malaperle
Reviewed By: sammccall
Subscribers: malaperle, klimek, mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D40897
llvm-svn: 320486
2017-12-12 23:42:10 +08:00
|
|
|
index/Index.cpp
|
2017-12-14 22:50:58 +08:00
|
|
|
index/MemIndex.cpp
|
2018-01-15 20:33:00 +08:00
|
|
|
index/Merge.cpp
|
[clangd] Introduce a "Symbol" class.
Summary:
* The "Symbol" class represents a C++ symbol in the codebase, containing all the
information of a C++ symbol needed by clangd. clangd will use it in clangd's
AST/dynamic index and global/static index (code completion and code
navigation).
* The SymbolCollector (another IndexAction) will be used to recollect the
symbols when the source file is changed (for ASTIndex), or to generate
all C++ symbols for the whole project.
In the long term (when index-while-building is ready), clangd should share a
same "Symbol" structure and IndexAction with index-while-building, but
for now we want to have some stuff working in clangd.
Reviewers: ioeric, sammccall, ilya-biryukov, malaperle
Reviewed By: sammccall
Subscribers: malaperle, klimek, mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D40897
llvm-svn: 320486
2017-12-12 23:42:10 +08:00
|
|
|
index/SymbolCollector.cpp
|
2017-12-14 20:17:14 +08:00
|
|
|
index/SymbolYAML.cpp
|
2017-02-07 18:28:20 +08:00
|
|
|
|
[clangd] Introduce Dex symbol index search tokens
This patch introduces the core building block of the next-generation
Clangd symbol index - Dex. Search tokens are the keys in the inverted
index and represent a characteristic of a specific symbol: examples of
search token types (Token Namespaces) are
* Trigrams - these are essential for unqualified symbol name fuzzy
search * Scopes for filtering the symbols by the namespace * Paths, e.g.
these can be used to uprank symbols defined close to the edited file
This patch outlines the generic for such token namespaces, but only
implements trigram generation.
The intuition behind trigram generation algorithm is that each extracted
trigram is a valid sequence for Fuzzy Matcher jumps, proposed
implementation utilize existing FuzzyMatcher API for segmentation and
trigram extraction.
However, trigrams generation algorithm for the query string is different
from the previous one: it simply yields sequences of 3 consecutive
lowercased valid characters (letters, digits).
Dex RFC in the mailing list:
http://lists.llvm.org/pipermail/clangd-dev/2018-July/000022.html
The trigram generation techniques are described in detail in the
proposal:
https://docs.google.com/document/d/1C-A6PGT6TynyaX4PXyExNMiGmJ2jL1UwV91Kyx11gOI/edit#heading=h.903u1zon9nkj
Reviewers: sammccall, ioeric, ilya-biryukovA
Subscribers: cfe-commits, klimek, mgorny, MaskRay, jkorous, arphaman
Differential Revision: https://reviews.llvm.org/D49591
llvm-svn: 337901
2018-07-25 18:34:57 +08:00
|
|
|
index/dex/Trigram.cpp
|
|
|
|
|
2017-05-23 18:17:48 +08:00
|
|
|
LINK_LIBS
|
2017-05-23 21:59:37 +08:00
|
|
|
clangAST
|
2018-01-10 23:11:26 +08:00
|
|
|
clangASTMatchers
|
2017-02-07 18:28:20 +08:00
|
|
|
clangBasic
|
2018-05-24 23:54:32 +08:00
|
|
|
clangDriver
|
2017-02-07 18:28:20 +08:00
|
|
|
clangFormat
|
2017-02-15 23:04:20 +08:00
|
|
|
clangFrontend
|
2017-06-29 00:12:10 +08:00
|
|
|
clangIndex
|
2017-06-29 06:57:15 +08:00
|
|
|
clangLex
|
2017-04-05 03:42:29 +08:00
|
|
|
clangSema
|
2017-07-22 07:48:26 +08:00
|
|
|
clangSerialization
|
2017-02-15 23:04:20 +08:00
|
|
|
clangTooling
|
2017-03-02 00:23:40 +08:00
|
|
|
clangToolingCore
|
2018-06-04 17:04:28 +08:00
|
|
|
clangToolingInclusions
|
2017-11-09 19:30:04 +08:00
|
|
|
clangToolingRefactor
|
2017-05-23 18:29:54 +08:00
|
|
|
${LLVM_PTHREAD_LIB}
|
2018-04-03 17:40:07 +08:00
|
|
|
${CLANGD_ATOMIC_LIB}
|
2017-02-07 18:28:20 +08:00
|
|
|
)
|
2017-05-23 16:12:45 +08:00
|
|
|
|
2017-10-26 18:03:11 +08:00
|
|
|
if( LLVM_LIB_FUZZING_ENGINE OR LLVM_USE_SANITIZE_COVERAGE )
|
|
|
|
add_subdirectory(fuzzer)
|
|
|
|
endif()
|
2017-05-23 16:12:45 +08:00
|
|
|
add_subdirectory(tool)
|
2017-12-22 22:38:05 +08:00
|
|
|
add_subdirectory(global-symbol-builder)
|