[clang-tools-extra] [clangd] Add container field to remote index Refs grpc method (PR #71605)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 28 18:22:54 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 5784bf85bc5143266565586ece0113cd773a8616 81271a1a536ca950eba328e5e84571e20a37d46e -- clang-tools-extra/clangd/ClangdLSPServer.cpp clang-tools-extra/clangd/ClangdServer.cpp clang-tools-extra/clangd/index/YAMLSerialization.cpp clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp clang-tools-extra/clangd/support/Trace.cpp clang-tools-extra/clangd/support/Trace.h clang-tools-extra/clangd/unittests/remote/MarshallingTests.cpp clang-tools-extra/clangd/unittests/support/TraceTests.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang-tools-extra/clangd/ClangdLSPServer.cpp b/clang-tools-extra/clangd/ClangdLSPServer.cpp
index 562d33a362..e6840faed1 100644
--- a/clang-tools-extra/clangd/ClangdLSPServer.cpp
+++ b/clang-tools-extra/clangd/ClangdLSPServer.cpp
@@ -416,13 +416,11 @@ private:
Server.Opts.Encoding.value_or(OffsetEncoding::UTF16));
}
- Context handlerContext(const std::string& ID) const {
- return Context::current().derive(
- kCurrentOffsetEncoding,
- Server.Opts.Encoding.value_or(OffsetEncoding::UTF16)).derive(
- trace::EventTracer::kRequestId,
- ID
- );
+ Context handlerContext(const std::string &ID) const {
+ return Context::current()
+ .derive(kCurrentOffsetEncoding,
+ Server.Opts.Encoding.value_or(OffsetEncoding::UTF16))
+ .derive(trace::EventTracer::kRequestId, ID);
}
// We run cancelable requests in a context that does two things:
diff --git a/clang-tools-extra/clangd/ClangdServer.cpp b/clang-tools-extra/clangd/ClangdServer.cpp
index 48be7576f8..fcf990372b 100644
--- a/clang-tools-extra/clangd/ClangdServer.cpp
+++ b/clang-tools-extra/clangd/ClangdServer.cpp
@@ -781,15 +781,15 @@ void ClangdServer::applyTweak(PathRef File, Range Sel, StringRef TweakID,
void ClangdServer::locateSymbolAt(PathRef File, Position Pos,
Callback<std::vector<LocatedSymbol>> CB) {
- // Copy over the request ID from the current thread to the worker thread action
+ // Copy over the request ID from the current thread to the worker thread
+ // action
const auto rid = Context::current().get(trace::EventTracer::kRequestId);
auto Action = [Pos, CB = std::move(CB), rid,
this](llvm::Expected<InputsAndAST> InpAST) mutable {
if (!InpAST)
return CB(InpAST.takeError());
if (rid)
- Context::current().derive(trace::EventTracer::kRequestId,
- *rid);
+ Context::current().derive(trace::EventTracer::kRequestId, *rid);
CB(clangd::locateSymbolAt(InpAST->AST, Pos, Index));
};
diff --git a/clang-tools-extra/clangd/support/Trace.cpp b/clang-tools-extra/clangd/support/Trace.cpp
index 78c4dda658..22e12bbf5d 100644
--- a/clang-tools-extra/clangd/support/Trace.cpp
+++ b/clang-tools-extra/clangd/support/Trace.cpp
@@ -88,8 +88,10 @@ public:
/// Called whenever a metrics records a measurement.
void record(const Metric &Metric, double Value,
- llvm::StringRef Label) override {
- instant("Metric", llvm::json::Object{{"name", Metric.Name}, {"value", Value}, {"label", Label}});
+ llvm::StringRef Label) override {
+ instant("Metric", llvm::json::Object{{"name", Metric.Name},
+ {"value", Value},
+ {"label", Label}});
}
private:
``````````
</details>
https://github.com/llvm/llvm-project/pull/71605
More information about the cfe-commits
mailing list