tree-sitter and lsp-methods
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./set_trace.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
|
||||
namespace lsp::providers
|
||||
{
|
||||
std::string SetTrace::GetMethod() const
|
||||
{
|
||||
return "$/setTrace";
|
||||
}
|
||||
|
||||
std::string SetTrace::GetProviderName() const
|
||||
{
|
||||
return "SetTrace";
|
||||
}
|
||||
|
||||
void SetTrace::HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context)
|
||||
{
|
||||
static_cast<void>(context);
|
||||
spdlog::debug("SetTraceProvider: Providing response for method {}", notification.method);
|
||||
|
||||
protocol::SetTraceParams params = transform::As<protocol::SetTraceParams>(notification.params.value());
|
||||
if (params.value == protocol::TraceValueLiterals::Off)
|
||||
{
|
||||
spdlog::set_level(spdlog::level::info);
|
||||
spdlog::info("SetTrace: Tacing disabled");
|
||||
}
|
||||
else if (params.value == protocol::TraceValueLiterals::Messages)
|
||||
{
|
||||
spdlog::set_level(spdlog::level::debug);
|
||||
spdlog::info("SetTrace: Tacing enabled (message only)");
|
||||
}
|
||||
else if (params.value == protocol::TraceValueLiterals::Verbose)
|
||||
{
|
||||
spdlog::set_level(spdlog::level::trace);
|
||||
spdlog::info("SetTrace: Tacing enabled (verbose)");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+13
-14
@@ -1,14 +1,13 @@
|
||||
#pragma once
|
||||
#include "../base/provider_interface.hpp"
|
||||
|
||||
namespace lsp::providers::set_trace
|
||||
{
|
||||
class SetTraceProvider : public INotificationProvider
|
||||
{
|
||||
public:
|
||||
SetTraceProvider() = default;
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
void HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
#pragma once
|
||||
#include "../base/provider_interface.hpp"
|
||||
|
||||
namespace lsp::providers
|
||||
{
|
||||
class SetTrace : public INotificationProvider
|
||||
{
|
||||
public:
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
void HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./set_trace_provider.hpp"
|
||||
|
||||
namespace lsp::providers::set_trace
|
||||
{
|
||||
std::string SetTraceProvider::GetMethod() const
|
||||
{
|
||||
return "$/setTrace";
|
||||
}
|
||||
|
||||
std::string SetTraceProvider::GetProviderName() const
|
||||
{
|
||||
return "SetTraceProvider";
|
||||
}
|
||||
|
||||
void SetTraceProvider::HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context)
|
||||
{
|
||||
static_cast<void>(context);
|
||||
spdlog::debug("SetTraceProvider: Providing response for method {}", notification.method);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user