枚举修正
This commit is contained in:
parent
4deb0b6d87
commit
174d484d93
|
|
@ -66,7 +66,7 @@ namespace lsp::core
|
||||||
catch (const std::exception& e)
|
catch (const std::exception& e)
|
||||||
{
|
{
|
||||||
spdlog::error("Provider error for method [{}]: {}", request.method, e.what());
|
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);
|
return HandleUnknownRequest(request);
|
||||||
|
|
@ -175,7 +175,7 @@ namespace lsp::core
|
||||||
|
|
||||||
std::string RequestDispatcher::HandleUnknownRequest(const protocol::RequestMessage& request)
|
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)
|
void RequestDispatcher::HandleUnknownNotification(const protocol::NotificationMessage& notification)
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,7 @@ namespace lsp::core
|
||||||
catch (const std::exception& e)
|
catch (const std::exception& e)
|
||||||
{
|
{
|
||||||
spdlog::error("Request processing failed: {}", e.what());
|
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); });
|
} }, [this](const std::string& response) { SendResponse(response); });
|
||||||
}
|
}
|
||||||
spdlog::debug("Processing request method: {}", request.method);
|
spdlog::debug("Processing request method: {}", request.method);
|
||||||
|
|
@ -305,10 +305,10 @@ namespace lsp::core
|
||||||
void LspServer::SendStateError(const protocol::RequestMessage& request)
|
void LspServer::SendStateError(const protocol::RequestMessage& request)
|
||||||
{
|
{
|
||||||
if (!is_initialized_)
|
if (!is_initialized_)
|
||||||
SendError(request, protocol::ErrorCodes::kServerNotInitialized, "Server not initialized");
|
SendError(request, protocol::ErrorCodes::ServerNotInitialized, "Server not initialized");
|
||||||
else if (is_shutting_down_)
|
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
|
else
|
||||||
SendError(request, protocol::ErrorCodes::kInternalError, "Request not allowed in current state");
|
SendError(request, protocol::ErrorCodes::InternalError, "Request not allowed in current state");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue