[Mlir-commits] [mlir] [mlir-lsp] Abstract input and output of the `JSONTransport` (PR #129320)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Feb 28 13:35:20 PST 2025
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 b8337bc5126d2728f84ce0e06bd019c486203b31 c189c5312d0f1f0d23f3f1033e12f1d748aacfe7 --extensions cpp,h -- mlir/include/mlir/Tools/lsp-server-support/Transport.h mlir/lib/Tools/lsp-server-support/Transport.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/include/mlir/Tools/lsp-server-support/Transport.h b/mlir/include/mlir/Tools/lsp-server-support/Transport.h
index 4b01b545fc..78f9d48e41 100644
--- a/mlir/include/mlir/Tools/lsp-server-support/Transport.h
+++ b/mlir/include/mlir/Tools/lsp-server-support/Transport.h
@@ -134,6 +134,7 @@ public:
/// Dispatches the given incoming json message to the message handler.
bool handleMessage(llvm::json::Value msg, MessageHandler &handler);
+
private:
/// The input to read a message from.
std::unique_ptr<JSONTransportInput> in;
diff --git a/mlir/lib/Tools/lsp-server-support/Transport.cpp b/mlir/lib/Tools/lsp-server-support/Transport.cpp
index fbb9a7acc1..d6806bf5cf 100644
--- a/mlir/lib/Tools/lsp-server-support/Transport.cpp
+++ b/mlir/lib/Tools/lsp-server-support/Transport.cpp
@@ -350,7 +350,8 @@ JSONTransportInputOverFile::readStandardMessage(std::string &json) {
/// This is a testing path, so favor simplicity over performance here.
/// When returning failure: feof(), ferror(), or shutdownRequested() will be
/// set.
-LogicalResult JSONTransportInputOverFile::readDelimitedMessage(std::string &json) {
+LogicalResult
+JSONTransportInputOverFile::readDelimitedMessage(std::string &json) {
json.clear();
llvm::SmallString<128> line;
while (succeeded(readLine(in, line))) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/129320
More information about the Mlir-commits
mailing list