diff options
| author | Eric Liu <ioeric@google.com> | 2017-12-19 16:50:37 +0000 |
|---|---|---|
| committer | Eric Liu <ioeric@google.com> | 2017-12-19 16:50:37 +0000 |
| commit | 6f648df1b940ac707ac05390c236015c92f5996f (patch) | |
| tree | b1419b2daeaaecd2e621bd491411f4085ebd6630 /clang-tools-extra/clangd/index/FileIndex.cpp | |
| parent | 6b15ace4384dd73e97e42250b3dcd2071bed302a (diff) | |
| download | bcm5719-llvm-6f648df1b940ac707ac05390c236015c92f5996f.tar.gz bcm5719-llvm-6f648df1b940ac707ac05390c236015c92f5996f.zip | |
[clangd] Index-based code completion.
Summary: Use symbol index to populate completion results for qualfified IDs e.g. "nx::A^".
Reviewers: ilya-biryukov, sammccall
Reviewed By: ilya-biryukov, sammccall
Subscribers: rwols, klimek, mgorny, cfe-commits, sammccall
Differential Revision: https://reviews.llvm.org/D41281
llvm-svn: 321083
Diffstat (limited to 'clang-tools-extra/clangd/index/FileIndex.cpp')
| -rw-r--r-- | clang-tools-extra/clangd/index/FileIndex.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang-tools-extra/clangd/index/FileIndex.cpp b/clang-tools-extra/clangd/index/FileIndex.cpp index 1e0016a2c34..5f4e157bd35 100644 --- a/clang-tools-extra/clangd/index/FileIndex.cpp +++ b/clang-tools-extra/clangd/index/FileIndex.cpp @@ -63,7 +63,7 @@ std::shared_ptr<std::vector<const Symbol *>> FileSymbols::allSymbols() { return {std::move(Snap), Pointers}; } -void FileIndex::update(Context &Ctx, PathRef Path, ParsedAST *AST) { +void FileIndex::update(const Context &Ctx, PathRef Path, ParsedAST *AST) { if (!AST) { FSymbols.update(Path, nullptr); } else { @@ -74,7 +74,7 @@ void FileIndex::update(Context &Ctx, PathRef Path, ParsedAST *AST) { Index.build(std::move(Symbols)); } -bool FileIndex::fuzzyFind(Context &Ctx, const FuzzyFindRequest &Req, +bool FileIndex::fuzzyFind(const Context &Ctx, const FuzzyFindRequest &Req, std::function<void(const Symbol &)> Callback) const { return Index.fuzzyFind(Ctx, Req, std::move(Callback)); } |

