kadircet created this revision.
kadircet added a reviewer: sammccall.
Herald added subscribers: usaxena95, arphaman.
kadircet requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.
Herald added a project: clang-tools-extra.

See https://github.com/clangd/clangd/issues/649#issuecomment-885903316.
Also disables config support in lit tests to make sure tests are not affected by
clangd config files lying around.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107130

Files:
  clang-tools-extra/clangd/test/check-fail.test
  clang-tools-extra/clangd/test/check-lines.test
  clang-tools-extra/clangd/test/check.test
  clang-tools-extra/clangd/tool/Check.cpp


Index: clang-tools-extra/clangd/tool/Check.cpp
===================================================================
--- clang-tools-extra/clangd/tool/Check.cpp
+++ clang-tools-extra/clangd/tool/Check.cpp
@@ -272,7 +272,7 @@
 
   auto ContextProvider = ClangdServer::createConfiguredContextProvider(
       Opts.ConfigProvider, nullptr);
-  WithContext Ctx(ContextProvider(""));
+  WithContext Ctx(ContextProvider(File));
   Checker C(File, Opts);
   if (!C.buildCommand(TFS) || !C.buildInvocation(TFS, Contents) ||
       !C.buildAST())
Index: clang-tools-extra/clangd/test/check.test
===================================================================
--- clang-tools-extra/clangd/test/check.test
+++ clang-tools-extra/clangd/test/check.test
@@ -1,5 +1,5 @@
 // RUN: cp %s %t.cpp
-// RUN: clangd -log=verbose -check=%t.cpp 2>&1 | FileCheck -strict-whitespace 
%s
+// RUN: clangd -enable-config=0 -log=verbose -check=%t.cpp 2>&1 | FileCheck 
-strict-whitespace %s
 
 // CHECK: Testing on source file
 // CHECK: internal (cc1) args are: -cc1
Index: clang-tools-extra/clangd/test/check-lines.test
===================================================================
--- clang-tools-extra/clangd/test/check-lines.test
+++ clang-tools-extra/clangd/test/check-lines.test
@@ -1,6 +1,6 @@
 // RUN: cp %s %t.cpp
-// RUN: not clangd -check=%t.cpp -check-lines=6-14 2>&1 | FileCheck 
-strict-whitespace %s
-// RUN: not clangd -check=%t.cpp -check-lines=14 2>&1 | FileCheck 
-strict-whitespace %s
+// RUN: not clangd -enable-config=0 -check=%t.cpp -check-lines=6-14 2>&1 | 
FileCheck -strict-whitespace %s
+// RUN: not clangd -enable-config=0 -check=%t.cpp -check-lines=14 2>&1 | 
FileCheck -strict-whitespace %s
 
 // CHECK: Testing on source file {{.*}}check-lines.test
 // CHECK: internal (cc1) args are: -cc1
Index: clang-tools-extra/clangd/test/check-fail.test
===================================================================
--- clang-tools-extra/clangd/test/check-fail.test
+++ clang-tools-extra/clangd/test/check-fail.test
@@ -1,5 +1,5 @@
 // RUN: cp %s %t.cpp
-// RUN: not clangd -check=%t.cpp 2>&1 | FileCheck -strict-whitespace %s
+// RUN: not clangd -enable-config=0 -check=%t.cpp 2>&1 | FileCheck 
-strict-whitespace %s
 
 // CHECK: Testing on source file {{.*}}check-fail.test
 // CHECK: internal (cc1) args are: -cc1


Index: clang-tools-extra/clangd/tool/Check.cpp
===================================================================
--- clang-tools-extra/clangd/tool/Check.cpp
+++ clang-tools-extra/clangd/tool/Check.cpp
@@ -272,7 +272,7 @@
 
   auto ContextProvider = ClangdServer::createConfiguredContextProvider(
       Opts.ConfigProvider, nullptr);
-  WithContext Ctx(ContextProvider(""));
+  WithContext Ctx(ContextProvider(File));
   Checker C(File, Opts);
   if (!C.buildCommand(TFS) || !C.buildInvocation(TFS, Contents) ||
       !C.buildAST())
Index: clang-tools-extra/clangd/test/check.test
===================================================================
--- clang-tools-extra/clangd/test/check.test
+++ clang-tools-extra/clangd/test/check.test
@@ -1,5 +1,5 @@
 // RUN: cp %s %t.cpp
-// RUN: clangd -log=verbose -check=%t.cpp 2>&1 | FileCheck -strict-whitespace %s
+// RUN: clangd -enable-config=0 -log=verbose -check=%t.cpp 2>&1 | FileCheck -strict-whitespace %s
 
 // CHECK: Testing on source file
 // CHECK: internal (cc1) args are: -cc1
Index: clang-tools-extra/clangd/test/check-lines.test
===================================================================
--- clang-tools-extra/clangd/test/check-lines.test
+++ clang-tools-extra/clangd/test/check-lines.test
@@ -1,6 +1,6 @@
 // RUN: cp %s %t.cpp
-// RUN: not clangd -check=%t.cpp -check-lines=6-14 2>&1 | FileCheck -strict-whitespace %s
-// RUN: not clangd -check=%t.cpp -check-lines=14 2>&1 | FileCheck -strict-whitespace %s
+// RUN: not clangd -enable-config=0 -check=%t.cpp -check-lines=6-14 2>&1 | FileCheck -strict-whitespace %s
+// RUN: not clangd -enable-config=0 -check=%t.cpp -check-lines=14 2>&1 | FileCheck -strict-whitespace %s
 
 // CHECK: Testing on source file {{.*}}check-lines.test
 // CHECK: internal (cc1) args are: -cc1
Index: clang-tools-extra/clangd/test/check-fail.test
===================================================================
--- clang-tools-extra/clangd/test/check-fail.test
+++ clang-tools-extra/clangd/test/check-fail.test
@@ -1,5 +1,5 @@
 // RUN: cp %s %t.cpp
-// RUN: not clangd -check=%t.cpp 2>&1 | FileCheck -strict-whitespace %s
+// RUN: not clangd -enable-config=0 -check=%t.cpp 2>&1 | FileCheck -strict-whitespace %s
 
 // CHECK: Testing on source file {{.*}}check-fail.test
 // CHECK: internal (cc1) args are: -cc1
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to