Revert 4 last "[mlir-lsp]" commits: pre-merge bot is broken

This reverts commits:
- f3f6f22dfcced21116710a477c78e0739c942139.
- 37e13d4924841bd84edb8c67c667d6d2a6c2bc63.
- ba1b52e6e764ad637822f0b63d144eca6e5d5627.
- 84bc21f9101730af611a0175d89ae2056d5f41a7.

GitOrigin-RevId: 6844c2feae93dd42516851057277f6130f1864e1
diff --git a/include/mlir/Tools/lsp-server-support/Transport.h b/include/mlir/Tools/lsp-server-support/Transport.h
index 44c7105..ce742be 100644
--- a/include/mlir/Tools/lsp-server-support/Transport.h
+++ b/include/mlir/Tools/lsp-server-support/Transport.h
@@ -147,15 +147,9 @@
                     void (ThisT::*handler)(const Param &)) {
     notificationHandlers[method] = [method, handler,
                                     thisPtr](llvm::json::Value rawParams) {
-      llvm::Expected<Param> param =
-          parse<Param>(rawParams, method, "notification");
-      if (!param) {
-        return llvm::consumeError(
-            llvm::handleErrors(param.takeError(), [](const LSPError &lspError) {
-              Logger::error("JSON parsing error: {0}",
-                            lspError.message.c_str());
-            }));
-      }
+      llvm::Expected<Param> param = parse<Param>(rawParams, method, "request");
+      if (!param)
+        return llvm::consumeError(param.takeError());
       (thisPtr->*handler)(*param);
     };
   }
diff --git a/lib/Tools/lsp-server-support/Transport.cpp b/lib/Tools/lsp-server-support/Transport.cpp
index 339c5f3..64dea35 100644
--- a/lib/Tools/lsp-server-support/Transport.cpp
+++ b/lib/Tools/lsp-server-support/Transport.cpp
@@ -51,12 +51,12 @@
 
 Reply::Reply(const llvm::json::Value &id, llvm::StringRef method,
              JSONTransport &transport, std::mutex &transportOutputMutex)
-    : method(method), id(id), transport(&transport),
+    : id(id), transport(&transport),
       transportOutputMutex(transportOutputMutex) {}
 
 Reply::Reply(Reply &&other)
-    : method(other.method), replied(other.replied.load()),
-      id(std::move(other.id)), transport(other.transport),
+    : replied(other.replied.load()), id(std::move(other.id)),
+      transport(other.transport),
       transportOutputMutex(other.transportOutputMutex) {
   other.transport = nullptr;
 }
diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt
index 6d8aa29..6fad249 100644
--- a/unittests/CMakeLists.txt
+++ b/unittests/CMakeLists.txt
@@ -20,7 +20,6 @@
 add_subdirectory(Rewrite)
 add_subdirectory(TableGen)
 add_subdirectory(Target)
-add_subdirectory(Tools)
 add_subdirectory(Transforms)
 
 if(MLIR_ENABLE_EXECUTION_ENGINE)
diff --git a/unittests/Tools/CMakeLists.txt b/unittests/Tools/CMakeLists.txt
deleted file mode 100644
index a97588d..0000000
--- a/unittests/Tools/CMakeLists.txt
+++ /dev/null
@@ -1 +0,0 @@
-add_subdirectory(lsp-server-support)
diff --git a/unittests/Tools/lsp-server-support/CMakeLists.txt b/unittests/Tools/lsp-server-support/CMakeLists.txt
deleted file mode 100644
index 3aa8b9c..0000000
--- a/unittests/Tools/lsp-server-support/CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-add_mlir_unittest(MLIRLspServerSupportTests
-  Transport.cpp
-)
-target_link_libraries(MLIRLspServerSupportTests
-  PRIVATE
-  MLIRLspServerSupportLib)
diff --git a/unittests/Tools/lsp-server-support/Transport.cpp b/unittests/Tools/lsp-server-support/Transport.cpp
deleted file mode 100644
index b46f02b..0000000
--- a/unittests/Tools/lsp-server-support/Transport.cpp
+++ /dev/null
@@ -1,128 +0,0 @@
-//===- Transport.cpp - LSP JSON transport unit tests ----------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#include "mlir/Tools/lsp-server-support/Transport.h"
-#include "mlir/Tools/lsp-server-support/Logging.h"
-#include "mlir/Tools/lsp-server-support/Protocol.h"
-#include "llvm/Support/FileSystem.h"
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-
-using namespace mlir;
-using namespace mlir::lsp;
-using namespace testing;
-
-namespace {
-
-TEST(TransportTest, SendReply) {
-  std::string out;
-  llvm::raw_string_ostream os(out);
-  JSONTransport transport(nullptr, os);
-  MessageHandler handler(transport);
-
-  transport.reply(1989, nullptr);
-  EXPECT_THAT(out, HasSubstr("\"id\":1989"));
-  EXPECT_THAT(out, HasSubstr("\"result\":null"));
-}
-
-class TransportInputTest : public Test {
-  std::optional<llvm::sys::fs::TempFile> inputTempFile;
-  std::FILE *in = nullptr;
-  std::string output = "";
-  llvm::raw_string_ostream os;
-  std::optional<JSONTransport> transport = std::nullopt;
-  std::optional<MessageHandler> messageHandler = std::nullopt;
-
-protected:
-  TransportInputTest() : os(output) {}
-
-  void SetUp() override {
-    auto tempOr = llvm::sys::fs::TempFile::create("lsp-unittest-%%%%%%.json");
-    ASSERT_TRUE((bool)tempOr);
-    llvm::sys::fs::TempFile t = std::move(*tempOr);
-    inputTempFile = std::move(t);
-
-    in = std::fopen(inputTempFile->TmpName.c_str(), "r");
-    transport.emplace(in, os, JSONStreamStyle::Delimited);
-    messageHandler.emplace(*transport);
-  }
-
-  void TearDown() override {
-    EXPECT_FALSE(inputTempFile->discard());
-    EXPECT_EQ(std::fclose(in), 0);
-  }
-
-  void writeInput(StringRef buffer) {
-    std::error_code ec;
-    llvm::raw_fd_ostream os(inputTempFile->TmpName, ec);
-    ASSERT_FALSE(ec);
-    os << buffer;
-    os.close();
-  }
-
-  StringRef getOutput() const { return output; }
-  MessageHandler &getMessageHandler() { return *messageHandler; }
-
-  void runTransport() {
-    bool gotEOF = false;
-    llvm::Error err = llvm::handleErrors(
-        transport->run(*messageHandler), [&](const llvm::ECError &ecErr) {
-          gotEOF = ecErr.convertToErrorCode() == std::errc::io_error;
-        });
-    llvm::consumeError(std::move(err));
-    EXPECT_TRUE(gotEOF);
-  }
-};
-
-TEST_F(TransportInputTest, RequestWithInvalidParams) {
-  struct Handler {
-    void onMethod(const TextDocumentItem &params,
-                  mlir::lsp::Callback<TextDocumentIdentifier> callback) {}
-  } handler;
-  getMessageHandler().method("invalid-params-request", &handler,
-                             &Handler::onMethod);
-
-  writeInput("{\"jsonrpc\":\"2.0\",\"id\":92,"
-             "\"method\":\"invalid-params-request\",\"params\":{}}\n");
-  runTransport();
-  EXPECT_THAT(getOutput(), HasSubstr("error"));
-  EXPECT_THAT(getOutput(), HasSubstr("missing value at (root).uri"));
-}
-
-TEST_F(TransportInputTest, NotificationWithInvalidParams) {
-  // JSON parsing errors are only reported via error logging. As a result, this
-  // test can't make any expectations -- but it prints the output anyway, by way
-  // of demonstration.
-  Logger::setLogLevel(Logger::Level::Error);
-
-  struct Handler {
-    void onNotification(const TextDocumentItem &params) {}
-  } handler;
-  getMessageHandler().notification("invalid-params-notification", &handler,
-                                   &Handler::onNotification);
-
-  writeInput("{\"jsonrpc\":\"2.0\",\"method\":\"invalid-params-notification\","
-             "\"params\":{}}\n");
-  runTransport();
-}
-
-TEST_F(TransportInputTest, MethodNotFound) {
-  writeInput("{\"jsonrpc\":\"2.0\",\"id\":29,\"method\":\"ack\"}\n");
-  runTransport();
-  EXPECT_THAT(getOutput(), HasSubstr("\"id\":29"));
-  EXPECT_THAT(getOutput(), HasSubstr("\"error\""));
-  EXPECT_THAT(getOutput(), HasSubstr("\"message\":\"method not found: ack\""));
-}
-
-TEST_F(TransportInputTest, OutgoingNotification) {
-  auto notifyFn = getMessageHandler().outgoingNotification<CompletionList>(
-      "outgoing-notification");
-  notifyFn(CompletionList{});
-  EXPECT_THAT(getOutput(), HasSubstr("\"method\":\"outgoing-notification\""));
-}
-} // namespace