[clangd] Set CWD in semaCodeComplete

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D81691
This commit is contained in:
Kadir Cetinkaya
2020-06-11 23:35:47 +02:00
parent 385e5f7e14
commit f44d2424f8
@@ -1116,6 +1116,9 @@ bool semaCodeComplete(std::unique_ptr<CodeCompleteConsumer> Consumer,
Input.ParseInput.FSProvider->getFileSystem();
if (Input.Preamble.StatCache)
VFS = Input.Preamble.StatCache->getConsumingFS(std::move(VFS));
if (VFS->setCurrentWorkingDirectory(
Input.ParseInput.CompileCommand.Directory))
elog("Couldn't set working directory during code completion");
auto Clang = prepareCompilerInstance(
std::move(CI), !CompletingInPreamble ? &Input.Preamble.Preamble : nullptr,
std::move(ContentsBuffer), std::move(VFS), IgnoreDiags);