From 174d484d9317c5a42fe23228f26b5c5d79f889f3 Mon Sep 17 00:00:00 2001 From: csh Date: Wed, 15 Oct 2025 22:59:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9E=9A=E4=B8=BE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lsp-server/src/core/dispacther.cpp | 4 ++-- lsp-server/src/core/server.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lsp-server/src/core/dispacther.cpp b/lsp-server/src/core/dispacther.cpp index e75b6e5..d2ae003 100644 --- a/lsp-server/src/core/dispacther.cpp +++ b/lsp-server/src/core/dispacther.cpp @@ -66,7 +66,7 @@ namespace lsp::core catch (const std::exception& e) { spdlog::error("Provider error for method [{}]: {}", request.method, e.what()); - return provider::BuildErrorResponseMessage(request, protocol::ErrorCodes::kInternalError, e.what()); + return provider::BuildErrorResponseMessage(request, protocol::ErrorCodes::InternalError, e.what()); } } return HandleUnknownRequest(request); @@ -175,7 +175,7 @@ namespace lsp::core std::string RequestDispatcher::HandleUnknownRequest(const protocol::RequestMessage& request) { - return provider::BuildErrorResponseMessage(request, protocol::ErrorCodes::kMethodNotFound, "Method not found: " + request.method); + return provider::BuildErrorResponseMessage(request, protocol::ErrorCodes::MethodNotFound, "Method not found: " + request.method); } void RequestDispatcher::HandleUnknownNotification(const protocol::NotificationMessage& notification) diff --git a/lsp-server/src/core/server.cpp b/lsp-server/src/core/server.cpp index 3c0d7db..45a260f 100644 --- a/lsp-server/src/core/server.cpp +++ b/lsp-server/src/core/server.cpp @@ -171,7 +171,7 @@ namespace lsp::core catch (const std::exception& e) { spdlog::error("Request processing failed: {}", e.what()); - return provider::BuildErrorResponseMessage(request, protocol::ErrorCodes::kInternalError, e.what()); + return provider::BuildErrorResponseMessage(request, protocol::ErrorCodes::InternalError, e.what()); } }, [this](const std::string& response) { SendResponse(response); }); } spdlog::debug("Processing request method: {}", request.method); @@ -305,10 +305,10 @@ namespace lsp::core void LspServer::SendStateError(const protocol::RequestMessage& request) { if (!is_initialized_) - SendError(request, protocol::ErrorCodes::kServerNotInitialized, "Server not initialized"); + SendError(request, protocol::ErrorCodes::ServerNotInitialized, "Server not initialized"); else if (is_shutting_down_) - SendError(request, protocol::ErrorCodes::kInvalidRequest, "Server is shutting down, only 'exit' is allowed"); + SendError(request, protocol::ErrorCodes::InvalidRequest, "Server is shutting down, only 'exit' is allowed"); else - SendError(request, protocol::ErrorCodes::kInternalError, "Request not allowed in current state"); + SendError(request, protocol::ErrorCodes::InternalError, "Request not allowed in current state"); } }