♻️ 使用module重构所有代码
This commit is contained in:
+26
-4
@@ -1,6 +1,28 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./set_trace.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
#include <string_view>
|
||||
|
||||
export module lsp.provider.trace.set_trace;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
namespace transform = lsp::codec;
|
||||
|
||||
export namespace lsp::provider
|
||||
{
|
||||
class SetTrace : public INotificationProvider
|
||||
{
|
||||
public:
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
void HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider
|
||||
{
|
||||
@@ -16,7 +38,7 @@ namespace lsp::provider
|
||||
|
||||
void SetTrace::HandleNotification(const protocol::NotificationMessage& notification, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("SetTrace notification {}", notification.method);
|
||||
spdlog::debug("SetTrace notification {}", notification.method);
|
||||
|
||||
protocol::SetTraceParams params = transform::FromLSPAny.template operator()<protocol::SetTraceParams>(notification.params.value());
|
||||
if (params.value == protocol::TraceValueLiterals::Off)
|
||||
@@ -1,13 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider
|
||||
{
|
||||
class SetTrace : public INotificationProvider
|
||||
{
|
||||
public:
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
void HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user