This revision was automatically updated to reflect the committed changes.
Closed by commit rL334485: [clangd] Support proximity paths in index fuzzy
find. (authored by ioeric, committed by ).
Herald added a subscriber: llvm-commits.
Repository:
rL LLVM
https://reviews.llvm.org/D47937
Files:
clang-tools-extra/trunk/clangd/CodeComplete.cpp
clang-tools-extra/trunk/clangd/index/Index.h
Index: clang-tools-extra/trunk/clangd/CodeComplete.cpp
===================================================================
--- clang-tools-extra/trunk/clangd/CodeComplete.cpp
+++ clang-tools-extra/trunk/clangd/CodeComplete.cpp
@@ -928,6 +928,7 @@
Req.RestrictForCodeCompletion = true;
Req.Scopes = getQueryScopes(Recorder->CCContext,
Recorder->CCSema->getSourceManager());
+ Req.ProximityPaths.push_back(FileName);
log(llvm::formatv("Code complete: fuzzyFind(\"{0}\", scopes=[{1}])",
Req.Query,
llvm::join(Req.Scopes.begin(), Req.Scopes.end(), ",")));
Index: clang-tools-extra/trunk/clangd/index/Index.h
===================================================================
--- clang-tools-extra/trunk/clangd/index/Index.h
+++ clang-tools-extra/trunk/clangd/index/Index.h
@@ -271,6 +271,9 @@
size_t MaxCandidateCount = UINT_MAX;
/// If set to true, only symbols for completion support will be considered.
bool RestrictForCodeCompletion = false;
+ /// Contextually relevant files (e.g. the file we're code-completing in).
+ /// Paths should be absolute.
+ std::vector<std::string> ProximityPaths;
};
struct LookupRequest {
Index: clang-tools-extra/trunk/clangd/CodeComplete.cpp
===================================================================
--- clang-tools-extra/trunk/clangd/CodeComplete.cpp
+++ clang-tools-extra/trunk/clangd/CodeComplete.cpp
@@ -928,6 +928,7 @@
Req.RestrictForCodeCompletion = true;
Req.Scopes = getQueryScopes(Recorder->CCContext,
Recorder->CCSema->getSourceManager());
+ Req.ProximityPaths.push_back(FileName);
log(llvm::formatv("Code complete: fuzzyFind(\"{0}\", scopes=[{1}])",
Req.Query,
llvm::join(Req.Scopes.begin(), Req.Scopes.end(), ",")));
Index: clang-tools-extra/trunk/clangd/index/Index.h
===================================================================
--- clang-tools-extra/trunk/clangd/index/Index.h
+++ clang-tools-extra/trunk/clangd/index/Index.h
@@ -271,6 +271,9 @@
size_t MaxCandidateCount = UINT_MAX;
/// If set to true, only symbols for completion support will be considered.
bool RestrictForCodeCompletion = false;
+ /// Contextually relevant files (e.g. the file we're code-completing in).
+ /// Paths should be absolute.
+ std::vector<std::string> ProximityPaths;
};
struct LookupRequest {
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits