This commit is contained in:
csh
2025-07-05 10:38:05 +08:00
parent 3cc1fccc81
commit 0c4619261d
39 changed files with 2085 additions and 875 deletions
@@ -1,18 +1,8 @@
#include <spdlog/spdlog.h>
#include "./set_trace_provider.hpp"
namespace lsp::providers::trace
namespace lsp::providers::set_trace
{
std::string SetTraceProvider::ProvideResponse(const protocol::RequestMessage& request)
{
spdlog::debug("SetTraceProvider: Providing response for method {}", request.method);
std::string json;
glz::obj empty_obj{}; // glaze的对象类型
auto ec = glz::write_json(empty_obj, json);
return ec ? BuildErrorResponseMessage(request, protocol::ErrorCode::kInternalError, "Internal error") : json;
}
std::string SetTraceProvider::GetMethod() const
{
return "$/setTrace";
@@ -23,4 +13,10 @@ namespace lsp::providers::trace
return "SetTraceProvider";
}
void SetTraceProvider::HandleNotification(const protocol::NotificationMessage& notification, ProviderContext& context)
{
static_cast<void>(context);
spdlog::debug("SetTraceProvider: Providing response for method {}", notification.method);
}
}
@@ -1,14 +1,14 @@
#pragma once
#include "../base/provider_interface.hpp"
namespace lsp::providers::trace
namespace lsp::providers::set_trace
{
class SetTraceProvider : public ILspProvider
class SetTraceProvider : public INotificationProvider
{
public:
SetTraceProvider() = default;
std::string ProvideResponse(const protocol::RequestMessage& request) override;
std::string GetMethod() const override;
std::string GetProviderName() const override;
void HandleNotification(const protocol::NotificationMessage& notification, ProviderContext& context) override;
};
}