✨ feat(provider): add compile-time registry
This commit is contained in:
@@ -14,28 +14,22 @@ namespace transform = lsp::codec;
|
||||
|
||||
export namespace lsp::provider
|
||||
{
|
||||
class Shutdown : public IRequestProvider
|
||||
class Shutdown : public AutoRegisterProvider<Shutdown, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "shutdown";
|
||||
static constexpr std::string_view kProviderName = "Shutdown";
|
||||
Shutdown() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider
|
||||
{
|
||||
std::string Shutdown::GetMethod() const
|
||||
{
|
||||
return "shutdown";
|
||||
}
|
||||
|
||||
|
||||
std::string Shutdown::GetProviderName() const
|
||||
{
|
||||
return "Shutdown";
|
||||
}
|
||||
|
||||
|
||||
std::string Shutdown::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
{
|
||||
@@ -56,4 +50,4 @@ namespace lsp::provider
|
||||
return json.value();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user