feat: support concurrency
This commit is contained in:
@@ -1,26 +1,26 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./initialized_provider.hpp"
|
||||
|
||||
namespace lsp::providers::initialized
|
||||
{
|
||||
|
||||
std::string InitializedProvider::ProvideResponse(const protocol::RequestMessage& request)
|
||||
{
|
||||
spdlog::debug("InitializeProvider: Providing response for method {}", request.method);
|
||||
std::string json;
|
||||
glz::obj empty_obj{}; // glaze的对象类型
|
||||
auto ec = glz::write_json(empty_obj, json);
|
||||
return ec ? BuildErrorMessageResponse(protocol::ErrorCode::kInternalError, "Internal error") : json;
|
||||
}
|
||||
|
||||
std::string InitializedProvider::GetMethod() const
|
||||
{
|
||||
return "initialized";
|
||||
}
|
||||
|
||||
std::string InitializedProvider::GetProviderName() const
|
||||
{
|
||||
return "InitializedProvider";
|
||||
}
|
||||
|
||||
}
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./initialized_provider.hpp"
|
||||
|
||||
namespace lsp::providers::initialized
|
||||
{
|
||||
|
||||
std::string InitializedProvider::ProvideResponse(const protocol::RequestMessage& request)
|
||||
{
|
||||
spdlog::debug("InitializeProvider: 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 InitializedProvider::GetMethod() const
|
||||
{
|
||||
return "initialized";
|
||||
}
|
||||
|
||||
std::string InitializedProvider::GetProviderName() const
|
||||
{
|
||||
return "InitializedProvider";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#pragma once
|
||||
#include "../base/provider_interface.hpp"
|
||||
|
||||
namespace lsp::providers::initialized
|
||||
{
|
||||
class InitializedProvider : public ILspProvider
|
||||
{
|
||||
public:
|
||||
InitializedProvider() = default;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request) override;
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
};
|
||||
}
|
||||
#pragma once
|
||||
#include "../base/provider_interface.hpp"
|
||||
|
||||
namespace lsp::providers::initialized
|
||||
{
|
||||
class InitializedProvider : public ILifecycleAwareProvider
|
||||
{
|
||||
public:
|
||||
InitializedProvider() = default;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request) override;
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user