diff options
-rw-r--r-- | clang-tools-extra/clangd/CodeComplete.cpp | 1 | ||||
-rw-r--r-- | clang-tools-extra/clangd/index/Index.h | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/CodeComplete.cpp b/clang-tools-extra/clangd/CodeComplete.cpp index 3d6bb5795d0..a5809c67922 100644 --- a/clang-tools-extra/clangd/CodeComplete.cpp +++ b/clang-tools-extra/clangd/CodeComplete.cpp @@ -928,6 +928,7 @@ private: 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(), ","))); diff --git a/clang-tools-extra/clangd/index/Index.h b/clang-tools-extra/clangd/index/Index.h index b74941cc2f0..b12d9218564 100644 --- a/clang-tools-extra/clangd/index/Index.h +++ b/clang-tools-extra/clangd/index/Index.h @@ -271,6 +271,9 @@ struct FuzzyFindRequest { 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 { |