[clang-tools-extra] c67b710 - [clangd] Add option to skip per-location checks.
Sam McCall via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 21 07:42:45 PST 2022
Author: Sam McCall
Date: 2022-11-21T16:41:53+01:00
New Revision: c67b710379402a48b0a158fa6247ae421ff9aa77
URL: https://github.com/llvm/llvm-project/commit/c67b710379402a48b0a158fa6247ae421ff9aa77
DIFF: https://github.com/llvm/llvm-project/commit/c67b710379402a48b0a158fa6247ae421ff9aa77.diff
LOG: [clangd] Add option to skip per-location checks.
This avoids a slow step after timing tidy checks for https://github.com/clangd/clangd/issues/1337
Added:
Modified:
clang-tools-extra/clangd/tool/Check.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clangd/tool/Check.cpp b/clang-tools-extra/clangd/tool/Check.cpp
index 9517d74123c6..49dfad90593d 100644
--- a/clang-tools-extra/clangd/tool/Check.cpp
+++ b/clang-tools-extra/clangd/tool/Check.cpp
@@ -72,6 +72,12 @@ llvm::cl::opt<std::string> CheckFileLines{
"testing to lines 3 to 7 (inclusive) or --check-lines=5 to restrict "
"to one line. Default is testing entire file."),
llvm::cl::init("")};
+llvm::cl::opt<bool> CheckLocations{
+ "check-locations",
+ llvm::cl::desc(
+ "Runs certain features (e.g. hover) at each point in the file. "
+ "Somewhat slow."),
+ llvm::cl::init(true)};
llvm::cl::opt<bool> CheckCompletion{
"check-completion",
llvm::cl::desc("Run code-completion at each point (slow)"),
@@ -455,7 +461,8 @@ bool check(llvm::StringRef File, const ThreadsafeFS &TFS,
return false;
C.buildInlayHints(LineRange);
C.buildSemanticHighlighting(LineRange);
- C.testLocationFeatures(LineRange);
+ if (CheckLocations)
+ C.testLocationFeatures(LineRange);
log("All checks completed, {0} errors", C.ErrCount);
return C.ErrCount == 0;
More information about the cfe-commits
mailing list