31 lines
1.0 KiB
C++
31 lines
1.0 KiB
C++
#include <spdlog/spdlog.h>
|
|
#include "./unregister_capability.hpp"
|
|
#include "../../protocol/transform/facade.hpp"
|
|
|
|
namespace lsp::providers::client
|
|
{
|
|
std::string UnregisterCapability::GetMethod() const
|
|
{
|
|
return "client/unregisterCapability";
|
|
}
|
|
|
|
std::string UnregisterCapability::GetProviderName() const
|
|
{
|
|
return "ClientUnregisterCapability";
|
|
}
|
|
|
|
std::string UnregisterCapability::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
|
{
|
|
static_cast<void>(context);
|
|
spdlog::debug("UnregisterCapabilityProvider: Providing response for method {}", request.method);
|
|
protocol::ResponseMessage response;
|
|
response.id = request.id;
|
|
response.result = std::nullopt;
|
|
|
|
std::optional<std::string> json = transform::Serialize(response);
|
|
if (!json.has_value())
|
|
return BuildErrorResponseMessage(request, protocol::ErrorCodes::kInternalError, "Internal error");
|
|
return json.value();
|
|
}
|
|
}
|