diff options
6 files changed, 22 insertions, 23 deletions
diff --git a/clang-tools-extra/clangd/test/delimited-input-comment-at-the-end.test b/clang-tools-extra/clangd/test/delimited-input-comment-at-the-end.test index 34a248d..bbbd72f 100644 --- a/clang-tools-extra/clangd/test/delimited-input-comment-at-the-end.test +++ b/clang-tools-extra/clangd/test/delimited-input-comment-at-the-end.test @@ -1,4 +1,4 @@ -# RUN: clangd -input-style=delimited -run-synchronously -input-mirror-file %t < %s
+# RUN: clangd -input-style=delimited -sync -input-mirror-file %t < %s
# RUN: grep '{"jsonrpc":"2.0","id":3,"method":"exit"}' %t
#
# RUN: clangd -lit-test -input-mirror-file %t < %s
diff --git a/clang-tools-extra/clangd/test/input-mirror.test b/clang-tools-extra/clangd/test/input-mirror.test index 5284562..a34a4a0 100644 --- a/clang-tools-extra/clangd/test/input-mirror.test +++ b/clang-tools-extra/clangd/test/input-mirror.test @@ -1,4 +1,4 @@ -# RUN: clangd -pretty -run-synchronously -input-mirror-file %t < %s
+# RUN: clangd -pretty -sync -input-mirror-file %t < %s
# Note that we have to use '-b' as -input-mirror-file does not have a newline at the end of file.
# RUN: diff -b %t %s
# It is absolutely vital that this file has CRLF line endings.
diff --git a/clang-tools-extra/clangd/test/protocol.test b/clang-tools-extra/clangd/test/protocol.test index c218763..3e16c9e 100644 --- a/clang-tools-extra/clangd/test/protocol.test +++ b/clang-tools-extra/clangd/test/protocol.test @@ -1,5 +1,5 @@ -# RUN: not clangd -pretty -run-synchronously -enable-test-uri-scheme < %s | FileCheck -strict-whitespace %s
-# RUN: not clangd -pretty -run-synchronously -enable-test-uri-scheme < %s 2>&1 | FileCheck -check-prefix=STDERR %s
+# RUN: not clangd -pretty -sync -enable-test-uri-scheme < %s | FileCheck -strict-whitespace %s
+# RUN: not clangd -pretty -sync -enable-test-uri-scheme < %s 2>&1 | FileCheck -check-prefix=STDERR %s
# vim: fileformat=dos
# It is absolutely vital that this file has CRLF line endings.
#
diff --git a/clang-tools-extra/clangd/test/spaces-in-delimited-input.test b/clang-tools-extra/clangd/test/spaces-in-delimited-input.test index 9636425..dc2e2f5 100644 --- a/clang-tools-extra/clangd/test/spaces-in-delimited-input.test +++ b/clang-tools-extra/clangd/test/spaces-in-delimited-input.test @@ -1,5 +1,5 @@ -# RUN: clangd -input-style=delimited -run-synchronously < %s 2>&1 | FileCheck %s
-# RUN: clangd -lit-test -run-synchronously < %s 2>&1 | FileCheck %s
+# RUN: clangd -input-style=delimited -sync < %s 2>&1 | FileCheck %s
+# RUN: clangd -lit-test -sync < %s 2>&1 | FileCheck %s
#
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
diff --git a/clang-tools-extra/clangd/test/too_large.test b/clang-tools-extra/clangd/test/too_large.test index 7b846c3..7df981e 100644 --- a/clang-tools-extra/clangd/test/too_large.test +++ b/clang-tools-extra/clangd/test/too_large.test @@ -1,4 +1,4 @@ -# RUN: not clangd -run-synchronously < %s 2>&1 | FileCheck -check-prefix=STDERR %s
+# RUN: not clangd -sync < %s 2>&1 | FileCheck -check-prefix=STDERR %s
# vim: fileformat=dos
# It is absolutely vital that this file has CRLF line endings.
#
diff --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp b/clang-tools-extra/clangd/tool/ClangdMain.cpp index 44ca8a3..106b7d6 100644 --- a/clang-tools-extra/clangd/tool/ClangdMain.cpp +++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp @@ -96,8 +96,8 @@ static llvm::cl::opt<Logger::Level> LogLevel( static llvm::cl::opt<bool> Test("lit-test", - llvm::cl::desc("Abbreviation for -input-style=delimited -pretty " - "-run-synchronously -enable-test-scheme -log=verbose. " + llvm::cl::desc("Abbreviation for -input-style=delimited -pretty -sync " + "-enable-test-scheme -log=verbose." "Intended to simplify lit tests."), llvm::cl::init(false), llvm::cl::Hidden); @@ -122,10 +122,9 @@ static llvm::cl::opt<int> LimitResults( "0 means no limit. (default=100)"), llvm::cl::init(100)); -static llvm::cl::opt<bool> RunSynchronously( - "run-synchronously", - llvm::cl::desc("Parse on main thread. If set, -j is ignored"), - llvm::cl::init(false), llvm::cl::Hidden); +static llvm::cl::opt<bool> + Sync("sync", llvm::cl::desc("Parse on main thread. If set, -j is ignored"), + llvm::cl::init(false), llvm::cl::Hidden); static llvm::cl::opt<Path> ResourceDir("resource-dir", @@ -229,10 +228,10 @@ static llvm::cl::opt<std::string> ClangTidyChecks( ".clang-tidy files). Only meaningful when -clang-tidy flag is on."), llvm::cl::init("")); -static llvm::cl::opt<bool> EnableClangTidy( - "clang-tidy", - llvm::cl::desc("Enable clang-tidy diagnostics."), - llvm::cl::init(true)); +static llvm::cl::opt<bool> + EnableClangTidy("clang-tidy", + llvm::cl::desc("Enable clang-tidy diagnostics."), + llvm::cl::init(true)); static llvm::cl::opt<std::string> FallbackStyle("fallback-style", @@ -343,7 +342,7 @@ int main(int argc, char *argv[]) { "\n\thttps://clang.llvm.org/extra/clangd.html" "\n\thttps://microsoft.github.io/language-server-protocol/"); if (Test) { - RunSynchronously = true; + Sync = true; InputStyle = JSONStreamStyle::Delimited; LogLevel = Logger::Verbose; PrettyPrint = true; @@ -355,15 +354,15 @@ int main(int argc, char *argv[]) { "test", "Test scheme for clangd lit tests."); } - if (!RunSynchronously && WorkerThreadsCount == 0) { + if (!Sync && WorkerThreadsCount == 0) { llvm::errs() << "A number of worker threads cannot be 0. Did you mean to " - "specify -run-synchronously?"; + "specify -sync?"; return 1; } - if (RunSynchronously) { + if (Sync) { if (WorkerThreadsCount.getNumOccurrences()) - llvm::errs() << "Ignoring -j because -run-synchronously is set.\n"; + llvm::errs() << "Ignoring -j because -sync is set.\n"; WorkerThreadsCount = 0; } if (FallbackStyle.getNumOccurrences()) @@ -461,7 +460,7 @@ int main(int argc, char *argv[]) { if (auto Idx = loadIndex(IndexFile, /*UseDex=*/true)) Placeholder->reset(std::move(Idx)); }); - if (RunSynchronously) + if (Sync) AsyncIndexLoad.wait(); } Opts.StaticIndex = StaticIdx.get(); |