hanchenye-llvm-project/clang-tools-extra/include-fixer
Sam McCall 9c5ebf7039 [include-fixer] Add fuzzy SymbolIndex, where identifier needn't match exactly.
Summary:
Add fuzzy SymbolIndex, where identifier needn't match exactly.

The purpose for this is global autocomplete in clangd. The query will be a
partial identifier up to the cursor, and the results will be suggestions.

It's in include-fixer because:

  - it handles SymbolInfos, actually SymbolIndex is exactly the right interface
  - it's a good harness for lit testing the fuzzy YAML index
  - (Laziness: we can't unit test clangd until reorganizing with a tool/ dir)

Other questionable choices:

  - FuzzySymbolIndex, which just refines the contract of SymbolIndex. This is
    an interface to allow extension to large monorepos (*cough*)
  - an always-true safety check that Identifier == Name is removed from
    SymbolIndexManager, as it's not true for fuzzy matching
  - exposing -db=fuzzyYaml from include-fixer is not a very useful feature, and
    a non-orthogonal ui (fuzziness vs data source). -db=fixed is similar though.

Reviewers: bkramer

Subscribers: cfe-commits, mgorny

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

llvm-svn: 297630
2017-03-13 15:55:59 +00:00
..
find-all-symbols [include-fixer] Remove line number from Symbol identity 2017-03-09 10:47:44 +00:00
plugin [CMake] Fix pthread handling for out-of-tree builds 2017-02-10 01:59:20 +00:00
tool [include-fixer] Add fuzzy SymbolIndex, where identifier needn't match exactly. 2017-03-13 15:55:59 +00:00
CMakeLists.txt [include-fixer] Add fuzzy SymbolIndex, where identifier needn't match exactly. 2017-03-13 15:55:59 +00:00
FuzzySymbolIndex.cpp [include-fixer] Add fuzzy SymbolIndex, where identifier needn't match exactly. 2017-03-13 15:55:59 +00:00
FuzzySymbolIndex.h [include-fixer] Add fuzzy SymbolIndex, where identifier needn't match exactly. 2017-03-13 15:55:59 +00:00
InMemorySymbolIndex.cpp [include-fixer] Add usage count to find-all-symbols. 2017-02-28 08:13:15 +00:00
InMemorySymbolIndex.h [include-fixer] Add usage count to find-all-symbols. 2017-02-28 08:13:15 +00:00
IncludeFixer.cpp [include-fixer] Remove line number from Symbol identity 2017-03-09 10:47:44 +00:00
IncludeFixer.h Reapply "Fix for shared_ptrification in Clang" 2017-01-06 19:49:09 +00:00
IncludeFixerContext.cpp [include-fixer] Support processing multiple files in one run. 2016-08-09 08:26:19 +00:00
IncludeFixerContext.h [include-fixer] Support processing multiple files in one run. 2016-08-09 08:26:19 +00:00
SymbolIndex.h [include-fixer] Add usage count to find-all-symbols. 2017-02-28 08:13:15 +00:00
SymbolIndexManager.cpp [include-fixer] Add fuzzy SymbolIndex, where identifier needn't match exactly. 2017-03-13 15:55:59 +00:00
SymbolIndexManager.h Fix the build of the include-fixer plugin for some shared cmake builds and MSVC. 2017-01-13 10:14:07 +00:00
YamlSymbolIndex.cpp [include-fixer] Add usage count to find-all-symbols. 2017-02-28 08:13:15 +00:00
YamlSymbolIndex.h [include-fixer] Add usage count to find-all-symbols. 2017-02-28 08:13:15 +00:00