[PATCH] D81691: [clangd] Set CWD in semaCodeComplete

2020-06-12 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment.

LGTM


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81691/new/

https://reviews.llvm.org/D81691



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D81691: [clangd] Set CWD in semaCodeComplete

2020-06-11 Thread Jan Korous via Phabricator via cfe-commits
jkorous added a comment.

A slightly tangential thing - we recently got an internal bugreport about 
clangd handling combination of working directory and relative paths for 
`-fmodules-cache-path` combination in compile_command.json incorrectly.
I tried some quick hacks but failed - it seems that ultimately the limiting 
factor is  the code in clang dealing with modules not using VFS. It's on our 
list of things to fix although we don't have a timeframe for it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81691/new/

https://reviews.llvm.org/D81691



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D81691: [clangd] Set CWD in semaCodeComplete

2020-06-11 Thread Kadir Cetinkaya via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs 
Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf44d2424f8d7: [clangd] Set CWD in semaCodeComplete (authored 
by kadircet).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81691/new/

https://reviews.llvm.org/D81691

Files:
  clang-tools-extra/clangd/CodeComplete.cpp


Index: clang-tools-extra/clangd/CodeComplete.cpp
===
--- clang-tools-extra/clangd/CodeComplete.cpp
+++ clang-tools-extra/clangd/CodeComplete.cpp
@@ -1116,6 +1116,9 @@
   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 ?  : 
nullptr,
   std::move(ContentsBuffer), std::move(VFS), IgnoreDiags);


Index: clang-tools-extra/clangd/CodeComplete.cpp
===
--- clang-tools-extra/clangd/CodeComplete.cpp
+++ clang-tools-extra/clangd/CodeComplete.cpp
@@ -1116,6 +1116,9 @@
   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 ?  : nullptr,
   std::move(ContentsBuffer), std::move(VFS), IgnoreDiags);
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D81691: [clangd] Set CWD in semaCodeComplete

2020-06-11 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision.
Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, MaskRay, 
ilya-biryukov.
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81691

Files:
  clang-tools-extra/clangd/CodeComplete.cpp


Index: clang-tools-extra/clangd/CodeComplete.cpp
===
--- clang-tools-extra/clangd/CodeComplete.cpp
+++ clang-tools-extra/clangd/CodeComplete.cpp
@@ -1116,6 +1116,9 @@
   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 ?  : 
nullptr,
   std::move(ContentsBuffer), std::move(VFS), IgnoreDiags);


Index: clang-tools-extra/clangd/CodeComplete.cpp
===
--- clang-tools-extra/clangd/CodeComplete.cpp
+++ clang-tools-extra/clangd/CodeComplete.cpp
@@ -1116,6 +1116,9 @@
   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 ?  : nullptr,
   std::move(ContentsBuffer), std::move(VFS), IgnoreDiags);
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits