llvm-project/clang-tools-extra/unittests/clangd
Sam McCall c5707b6c36 [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-15 17:43:27 +00:00
..
Annotations.cpp [clangd] Add line and column number to the index symbol. 2018-04-13 08:30:39 +00:00
Annotations.h [clangd] Add line and column number to the index symbol. 2018-04-13 08:30:39 +00:00
CMakeLists.txt [clangd] Extract scoring/ranking logic, and shave yaks. 2018-05-15 17:43:27 +00:00
ClangdTests.cpp [clangd] Remove LSP command-based #include insertion. 2018-05-15 15:23:53 +00:00
ClangdUnitTests.cpp [clangd] Extract scoring/ranking logic, and shave yaks. 2018-05-15 17:43:27 +00:00
CodeCompleteTests.cpp [clangd] Populate #include insertions as additional edits in completion items. 2018-05-15 15:29:32 +00:00
CodeCompletionStringsTests.cpp [clangd] Pull CodeCompletionString handling logic into its own file and add unit test. 2017-12-20 17:24:31 +00:00
ContextTests.cpp [clangd] Introduced a Context that stores implicit data 2017-12-12 11:16:45 +00:00
DraftStoreTests.cpp [clangd] Fix unicode handling, using UTF-16 where LSP requires it. 2018-04-27 11:59:28 +00:00
FileIndexTests.cpp [clangd] Extract scoring/ranking logic, and shave yaks. 2018-05-15 17:43:27 +00:00
FindSymbolsTests.cpp [clangd] Initialize candidate count in unit test 2018-04-24 17:57:53 +00:00
FuzzyMatchTests.cpp [clangd] Address missed comments from D44003 2018-03-06 14:30:07 +00:00
GlobalCompilationDatabaseTests.cpp Parse .h files as objective-c++ if we don't have a compile command. 2018-04-20 11:35:17 +00:00
HeadersTests.cpp [clangd] Populate #include insertions as additional edits in completion items. 2018-05-15 15:29:32 +00:00
IndexTests.cpp [clangd] Add an interface that finds symbol by SymbolID in SymbolIndex. 2018-03-14 09:48:05 +00:00
JSONExprTests.cpp [clangd] Use operator<< to prevent printers issues in Gtest 2018-04-10 17:34:46 +00:00
Matchers.h [clangd] Fix crash when CompilerInvocation can't be created. 2018-02-09 13:51:57 +00:00
QualityTests.cpp [clangd] Extract scoring/ranking logic, and shave yaks. 2018-05-15 17:43:27 +00:00
SourceCodeTests.cpp [clangd] Fix unicode handling, using UTF-16 where LSP requires it. 2018-04-27 11:59:28 +00:00
SymbolCollectorTests.cpp [clangd] Also use UTF-16 in index position. 2018-04-30 11:40:02 +00:00
SyncAPI.cpp [clangd] Implementation of workspace/symbol request 2018-04-23 20:00:52 +00:00
SyncAPI.h [clangd] Implementation of workspace/symbol request 2018-04-23 20:00:52 +00:00
TUSchedulerTests.cpp [clangd] Don't expose vfs in TUScheduler::runWithPreamble. 2018-03-14 17:46:52 +00:00
TestFS.cpp [clangd] Extract scoring/ranking logic, and shave yaks. 2018-05-15 17:43:27 +00:00
TestFS.h [clangd] Remove Tagged and some related APIs from ClangdServer. 2018-03-12 23:22:35 +00:00
TestScheme.h [clangd] Allow using customized include path in URI. 2018-04-09 15:09:44 +00:00
TestTU.cpp [clangd] Extract scoring/ranking logic, and shave yaks. 2018-05-15 17:43:27 +00:00
TestTU.h [clangd] Extract scoring/ranking logic, and shave yaks. 2018-05-15 17:43:27 +00:00
ThreadingTests.cpp [clangd] Tracing: name worker threads, and enforce naming scheduled async tasks 2018-02-19 09:56:28 +00:00
TraceTests.cpp Fix misuse of llvm::YAML in clangd test. 2018-03-23 19:16:07 +00:00
URITests.cpp s/LLVM_ON_WIN32/_WIN32/, clang-tools-extra 2018-04-10 13:14:03 +00:00
XRefsTests.cpp [clangd] Extract scoring/ranking logic, and shave yaks. 2018-05-15 17:43:27 +00:00