This commit is contained in:
csh 2025-07-05 13:18:34 +08:00
parent 0c4619261d
commit e2d88085f0
23 changed files with 112 additions and 84 deletions

View File

@ -5,12 +5,26 @@
namespace lsp::core namespace lsp::core
{ {
RequestDispatcher::RequestDispatcher()
{
// 预创建 lifecycle callback避免每次调用时都创建新的 lambda
context_lifecycle_callback_ = [this](providers::ServerLifecycleEvent event) {
NotifyAllLifecycleListeners(event);
};
}
void RequestDispatcher::SetRequestScheduler(scheduler::RequestScheduler* scheduler) void RequestDispatcher::SetRequestScheduler(scheduler::RequestScheduler* scheduler)
{ {
scheduler_ = scheduler; scheduler_ = scheduler;
spdlog::debug("RequestScheduler set in dispatcher"); spdlog::debug("RequestScheduler set in dispatcher");
} }
void RequestDispatcher::SetDocumentManager(services::DocumentManager* document_manager)
{
document_manager_ = document_manager;
spdlog::debug("DocumentManager is set in dispatcher");
}
void RequestDispatcher::RegisterRequestProvider(std::shared_ptr<providers::IRequestProvider> provider) void RequestDispatcher::RegisterRequestProvider(std::shared_ptr<providers::IRequestProvider> provider)
{ {
std::unique_lock<std::shared_mutex> lock(providers_mutex_); std::unique_lock<std::shared_mutex> lock(providers_mutex_);
@ -29,7 +43,7 @@ namespace lsp::core
spdlog::info("Registered notification provider '{}' for method: {}", provider->GetProviderName(), method); spdlog::info("Registered notification provider '{}' for method: {}", provider->GetProviderName(), method);
} }
void RequestDispatcher::RegisterLifecycleCallback(LifecycleCallback callback) void RequestDispatcher::RegisterLifecycleCallback(providers::LifecycleCallback callback)
{ {
std::lock_guard<std::mutex> lock(callbacks_mutex_); std::lock_guard<std::mutex> lock(callbacks_mutex_);
lifecycle_callbacks_.push_back(std::move(callback)); lifecycle_callbacks_.push_back(std::move(callback));
@ -38,12 +52,7 @@ namespace lsp::core
std::string RequestDispatcher::Dispatch(const protocol::RequestMessage& request) std::string RequestDispatcher::Dispatch(const protocol::RequestMessage& request)
{ {
providers::ProviderContext context( providers::ExecutionContext context(scheduler_, context_lifecycle_callback_, document_manager_);
scheduler_,
[this](ServerLifecycleEvent event)
{
NotifyAllLifecycleListeners(event);
});
std::shared_lock<std::shared_mutex> lock(providers_mutex_); std::shared_lock<std::shared_mutex> lock(providers_mutex_);
auto it = providers_.find(request.method); auto it = providers_.find(request.method);
@ -67,16 +76,9 @@ namespace lsp::core
void RequestDispatcher::Dispatch(const protocol::NotificationMessage& notification) void RequestDispatcher::Dispatch(const protocol::NotificationMessage& notification)
{ {
// 创建 provider context providers::ExecutionContext context(scheduler_, context_lifecycle_callback_, document_manager_);
providers::ProviderContext context(
scheduler_,
[this](ServerLifecycleEvent event)
{
NotifyAllLifecycleListeners(event);
});
std::shared_lock<std::shared_mutex> lock(notification_providers_mutex_); std::shared_lock<std::shared_mutex> lock(notification_providers_mutex_);
// 先尝试精确匹配 // 先尝试精确匹配
auto it = notification_providers_.find(notification.method); auto it = notification_providers_.find(notification.method);
if (it != notification_providers_.end()) if (it != notification_providers_.end())
@ -140,26 +142,26 @@ namespace lsp::core
return providers::IRequestProvider::BuildErrorResponseMessage(request, code, message); return providers::IRequestProvider::BuildErrorResponseMessage(request, code, message);
} }
void RequestDispatcher::NotifyAllLifecycleListeners(ServerLifecycleEvent event) void RequestDispatcher::NotifyAllLifecycleListeners(providers::ServerLifecycleEvent event)
{ {
std::lock_guard<std::mutex> lock(callbacks_mutex_); std::lock_guard<std::mutex> lock(callbacks_mutex_);
std::string event_name; std::string event_name;
switch (event) switch (event)
{ {
case ServerLifecycleEvent::kInitializing: case providers::ServerLifecycleEvent::kInitializing:
event_name = "Initializing"; event_name = "Initializing";
break; break;
case ServerLifecycleEvent::kInitialized: case providers::ServerLifecycleEvent::kInitialized:
event_name = "Initialized"; event_name = "Initialized";
break; break;
case ServerLifecycleEvent::kInitializeFailed: case providers::ServerLifecycleEvent::kInitializeFailed:
event_name = "InitializeFailed"; event_name = "InitializeFailed";
break; break;
case ServerLifecycleEvent::kShuttingDown: case providers::ServerLifecycleEvent::kShuttingDown:
event_name = "ShuttingDown"; event_name = "ShuttingDown";
break; break;
case ServerLifecycleEvent::kShutdown: case providers::ServerLifecycleEvent::kShutdown:
event_name = "Shutdown"; event_name = "Shutdown";
break; break;
} }

View File

@ -8,21 +8,19 @@
namespace lsp::core namespace lsp::core
{ {
using ServerLifecycleEvent = providers::ServerLifecycleEvent;
using LifecycleCallback = providers::LifecycleCallback;
class RequestDispatcher class RequestDispatcher
{ {
public: public:
RequestDispatcher() = default; RequestDispatcher();
~RequestDispatcher() = default; ~RequestDispatcher() = default;
void SetRequestScheduler(scheduler::RequestScheduler* scheduler); void SetRequestScheduler(scheduler::RequestScheduler* scheduler);
void SetDocumentManager(services::DocumentManager* document_manager);
void RegisterRequestProvider(std::shared_ptr<providers::IRequestProvider> provider); void RegisterRequestProvider(std::shared_ptr<providers::IRequestProvider> provider);
void RegisterNotificationProvider(std::shared_ptr<providers::INotificationProvider> provider); void RegisterNotificationProvider(std::shared_ptr<providers::INotificationProvider> provider);
void RegisterLifecycleCallback(LifecycleCallback callback); void RegisterLifecycleCallback(providers::LifecycleCallback callback);
std::string Dispatch(const protocol::RequestMessage& request); std::string Dispatch(const protocol::RequestMessage& request);
void Dispatch(const protocol::NotificationMessage& notification); void Dispatch(const protocol::NotificationMessage& notification);
@ -36,7 +34,7 @@ namespace lsp::core
std::string BuildErrorResponseMessage(const protocol::RequestMessage& request, protocol::ErrorCode code, const std::string& message); std::string BuildErrorResponseMessage(const protocol::RequestMessage& request, protocol::ErrorCode code, const std::string& message);
private: private:
void NotifyAllLifecycleListeners(ServerLifecycleEvent event); void NotifyAllLifecycleListeners(providers::ServerLifecycleEvent event);
std::string HandleUnknownRequest(const protocol::RequestMessage& request); std::string HandleUnknownRequest(const protocol::RequestMessage& request);
void HandleUnknownNotification(const protocol::NotificationMessage& notification); void HandleUnknownNotification(const protocol::NotificationMessage& notification);
@ -48,9 +46,13 @@ namespace lsp::core
std::unordered_map<std::string, std::shared_ptr<providers::INotificationProvider>> notification_providers_; std::unordered_map<std::string, std::shared_ptr<providers::INotificationProvider>> notification_providers_;
std::mutex callbacks_mutex_; std::mutex callbacks_mutex_;
std::vector<LifecycleCallback> lifecycle_callbacks_; std::vector<providers::LifecycleCallback> lifecycle_callbacks_;
providers::LifecycleCallback context_lifecycle_callback_;
// 服务引用
scheduler::RequestScheduler* scheduler_ = nullptr; scheduler::RequestScheduler* scheduler_ = nullptr;
services::DocumentManager* document_manager_ = nullptr;
}; };
} }

View File

@ -1,5 +1,6 @@
#include <exception> #include <exception>
#include <iostream> #include <iostream>
#include <memory>
#include <spdlog/spdlog.h> #include <spdlog/spdlog.h>
#ifdef _WIN32 #ifdef _WIN32
#include <io.h> #include <io.h>
@ -8,6 +9,7 @@
#include "../provider/base/provider_registry.hpp" #include "../provider/base/provider_registry.hpp"
#include "../protocol/transform/facade.hpp" #include "../protocol/transform/facade.hpp"
#include "../scheduler/request_scheduler.hpp" #include "../scheduler/request_scheduler.hpp"
#include "../services/document.hpp"
#include "./server.hpp" #include "./server.hpp"
namespace lsp::core namespace lsp::core
@ -17,17 +19,8 @@ namespace lsp::core
{ {
spdlog::info("Initializing LSP server with {} worker threads", concurrency); spdlog::info("Initializing LSP server with {} worker threads", concurrency);
dispatcher_.SetRequestScheduler(&scheduler_); InitializeCoreServices();
InitializeExtensionServices();
dispatcher_.RegisterLifecycleCallback(
[this](providers::ServerLifecycleEvent event) {
OnLifecycleEvent(event);
});
providers::RegisterAllProviders(dispatcher_);
scheduler_.SetResponseCallback([this](const std::string& response) {
SendResponse(response);
});
spdlog::debug("LSP server initialized with {} providers.", dispatcher_.GetAllSupportedMethods().size()); spdlog::debug("LSP server initialized with {} providers.", dispatcher_.GetAllSupportedMethods().size());
} }
@ -209,30 +202,30 @@ namespace lsp::core
spdlog::debug("Received response - id: {}", id_str); spdlog::debug("Received response - id: {}", id_str);
} }
void LspServer::OnLifecycleEvent(ServerLifecycleEvent event) void LspServer::OnLifecycleEvent(providers::ServerLifecycleEvent event)
{ {
switch (event) switch (event)
{ {
case ServerLifecycleEvent::kInitializing: case providers::ServerLifecycleEvent::kInitializing:
spdlog::info("Server initializing..."); spdlog::info("Server initializing...");
break; break;
case ServerLifecycleEvent::kInitialized: case providers::ServerLifecycleEvent::kInitialized:
is_initialized_ = true; is_initialized_ = true;
spdlog::info("Server initialized successfully"); spdlog::info("Server initialized successfully");
break; break;
case ServerLifecycleEvent::kInitializeFailed: case providers::ServerLifecycleEvent::kInitializeFailed:
is_initialized_ = false; is_initialized_ = false;
spdlog::error("Server initialization failed"); spdlog::error("Server initialization failed");
break; break;
case ServerLifecycleEvent::kShuttingDown: case providers::ServerLifecycleEvent::kShuttingDown:
is_shutting_down_ = true; is_shutting_down_ = true;
spdlog::info("Server entering shutdown state"); spdlog::info("Server entering shutdown state");
break; break;
case ServerLifecycleEvent::kShutdown: case providers::ServerLifecycleEvent::kShutdown:
is_shutting_down_ = true; is_shutting_down_ = true;
spdlog::info("Server shutdown complete"); spdlog::info("Server shutdown complete");
break; break;
@ -284,6 +277,27 @@ namespace lsp::core
spdlog::trace("Response sent - body: {}", response); spdlog::trace("Response sent - body: {}", response);
} }
void LspServer::InitializeCoreServices()
{
dispatcher_.SetRequestScheduler(&scheduler_);
dispatcher_.RegisterLifecycleCallback(
[this](providers::ServerLifecycleEvent event) {
OnLifecycleEvent(event);
});
providers::RegisterAllProviders(dispatcher_);
scheduler_.SetResponseCallback([this](const std::string& response) {
SendResponse(response);
});
}
void LspServer::InitializeExtensionServices()
{
document_manager_ = std::make_unique<services::DocumentManager>();
dispatcher_.SetDocumentManager(document_manager_.get());
}
void LspServer::SendError(const protocol::RequestMessage& request, protocol::ErrorCode code, const std::string& message) void LspServer::SendError(const protocol::RequestMessage& request, protocol::ErrorCode code, const std::string& message)
{ {
spdlog::warn("Sending error response - method: {}, code: {}, message: {}", request.method, static_cast<int>(code), message); spdlog::warn("Sending error response - method: {}, code: {}, message: {}", request.method, static_cast<int>(code), message);

View File

@ -1,5 +1,6 @@
#pragma once #pragma once
#include <atomic> #include <atomic>
#include <memory>
#include <optional> #include <optional>
#include <string> #include <string>
#include "./dispacther.hpp" #include "./dispacther.hpp"
@ -43,13 +44,19 @@ namespace lsp::core
void HandleCancelRequest(const protocol::NotificationMessage& notification); void HandleCancelRequest(const protocol::NotificationMessage& notification);
private: private:
void InitializeCoreServices();
void InitializeExtensionServices();
void SendError(const protocol::RequestMessage& request, protocol::ErrorCode code, const std::string& message); void SendError(const protocol::RequestMessage& request, protocol::ErrorCode code, const std::string& message);
void SendStateError(const protocol::RequestMessage& request); void SendStateError(const protocol::RequestMessage& request);
private: private:
// 核心组件-必需的生命周期和LspServer一致
RequestDispatcher dispatcher_; RequestDispatcher dispatcher_;
scheduler::RequestScheduler scheduler_; scheduler::RequestScheduler scheduler_;
// 可选/扩展组件 -- 所以用智能指针
std::unique_ptr<services::DocumentManager> document_manager_;
std::atomic<bool> is_initialized_ = false; std::atomic<bool> is_initialized_ = false;
std::atomic<bool> is_shutting_down_ = false; std::atomic<bool> is_shutting_down_ = false;
std::mutex output_mutex_; std::mutex output_mutex_;

View File

@ -3,6 +3,7 @@
#include <spdlog/spdlog.h> #include <spdlog/spdlog.h>
#include "../../protocol/protocol.hpp" #include "../../protocol/protocol.hpp"
#include "../../scheduler/request_scheduler.hpp" #include "../../scheduler/request_scheduler.hpp"
#include "../../services/document.hpp"
namespace lsp::providers namespace lsp::providers
{ {
@ -17,7 +18,27 @@ namespace lsp::providers
using LifecycleCallback = std::function<void(ServerLifecycleEvent)>; using LifecycleCallback = std::function<void(ServerLifecycleEvent)>;
class ProviderContext; class ExecutionContext
{
public:
ExecutionContext(scheduler::RequestScheduler* scheduler, LifecycleCallback lifecycle_callback, services::DocumentManager* document_manager = nullptr) :
scheduler_(scheduler), lifecycle_callback_(lifecycle_callback), document_manager_(document_manager) {}
scheduler::RequestScheduler* GetScheduler() const { return scheduler_; }
services::DocumentManager* GetDocumentManager() const { return document_manager_; }
void TriggerLifecycleEvent(ServerLifecycleEvent event) const
{
if (lifecycle_callback_)
lifecycle_callback_(event);
}
private:
scheduler::RequestScheduler* scheduler_;
LifecycleCallback lifecycle_callback_;
services::DocumentManager* document_manager_;
};
// LSP请求提供者接口基类 // LSP请求提供者接口基类
class IProvider class IProvider
@ -38,7 +59,7 @@ namespace lsp::providers
virtual ~IRequestProvider() = default; virtual ~IRequestProvider() = default;
// 处理LSP请求 // 处理LSP请求
virtual std::string ProvideResponse(const protocol::RequestMessage& request, ProviderContext& context) = 0; virtual std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) = 0;
static std::string BuildErrorResponseMessage(const protocol::RequestMessage& request, protocol::ErrorCode code, const std::string& message); static std::string BuildErrorResponseMessage(const protocol::RequestMessage& request, protocol::ErrorCode code, const std::string& message);
}; };
@ -49,25 +70,7 @@ namespace lsp::providers
virtual ~INotificationProvider() = default; virtual ~INotificationProvider() = default;
// 处理LSP通知 // 处理LSP通知
virtual void HandleNotification(const protocol::NotificationMessage& notification, ProviderContext& context) = 0; virtual void HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context) = 0;
}; };
class ProviderContext
{
public:
ProviderContext(scheduler::RequestScheduler* scheduler, LifecycleCallback lifecycle_callback) :
scheduler_(scheduler), lifecycle_callback_(lifecycle_callback) {}
scheduler::RequestScheduler* GetScheduler() const { return scheduler_; }
void TriggerLifecycleEvent(ServerLifecycleEvent event) const
{
if (lifecycle_callback_)
lifecycle_callback_(event);
}
private:
scheduler::RequestScheduler* scheduler_;
LifecycleCallback lifecycle_callback_;
};
} }

View File

@ -12,7 +12,7 @@ namespace lsp::providers::cancel_request
return "CancelRequestProvider"; return "CancelRequestProvider";
} }
void CancelRequestProvider::HandleNotification(const protocol::NotificationMessage& notification, ProviderContext& context) void CancelRequestProvider::HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context)
{ {
try try
{ {

View File

@ -11,6 +11,6 @@ namespace lsp::providers::cancel_request
public: public:
std::string GetMethod() const override; std::string GetMethod() const override;
std::string GetProviderName() const override; std::string GetProviderName() const override;
void HandleNotification(const protocol::NotificationMessage& notification, ProviderContext& context) override; void HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context) override;
}; };
} }

View File

@ -13,7 +13,7 @@ namespace lsp::providers::exit
return "ExitProvider"; return "ExitProvider";
} }
void ExitProvider::HandleNotification(const protocol::NotificationMessage& notification, ProviderContext& context) void ExitProvider::HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context)
{ {
// static_cast<void>(context); // static_cast<void>(context);
spdlog::debug("ExitProvider: Providing response for method {}", notification.method); spdlog::debug("ExitProvider: Providing response for method {}", notification.method);

View File

@ -8,6 +8,6 @@ namespace lsp::providers::exit
public: public:
std::string GetMethod() const override; std::string GetMethod() const override;
std::string GetProviderName() const override; std::string GetProviderName() const override;
void HandleNotification(const protocol::NotificationMessage& notification, ProviderContext& context) override; void HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context) override;
}; };
} }

View File

@ -14,7 +14,7 @@ namespace lsp::providers::initialize
return "InitializeProvider"; return "InitializeProvider";
} }
std::string InitializeProvider::ProvideResponse(const protocol::RequestMessage& request, ProviderContext& context) std::string InitializeProvider::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
{ {
spdlog::debug("InitializeProvider: Providing response for method {}", request.method); spdlog::debug("InitializeProvider: Providing response for method {}", request.method);
protocol::ResponseMessage response; protocol::ResponseMessage response;

View File

@ -8,7 +8,7 @@ namespace lsp::providers::initialize
{ {
public: public:
InitializeProvider() = default; InitializeProvider() = default;
std::string ProvideResponse(const protocol::RequestMessage& request, ProviderContext& context) override; std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
std::string GetMethod() const override; std::string GetMethod() const override;
std::string GetProviderName() const override; std::string GetProviderName() const override;

View File

@ -14,7 +14,7 @@ namespace lsp::providers::initialized
return "InitializedProvider"; return "InitializedProvider";
} }
void InitializedProvider::HandleNotification(const protocol::NotificationMessage& notification, ProviderContext& context) void InitializedProvider::HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context)
{ {
static_cast<void>(context); // 如果不需要上下文,可以忽略 static_cast<void>(context); // 如果不需要上下文,可以忽略
spdlog::debug("InitializeProvider: Providing response for method {}", notification.method); spdlog::debug("InitializeProvider: Providing response for method {}", notification.method);

View File

@ -9,6 +9,6 @@ namespace lsp::providers::initialized
InitializedProvider() = default; InitializedProvider() = default;
std::string GetMethod() const override; std::string GetMethod() const override;
std::string GetProviderName() const override; std::string GetProviderName() const override;
void HandleNotification(const protocol::NotificationMessage& notification, ProviderContext& context) override; void HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context) override;
}; };
} }

View File

@ -14,7 +14,7 @@ namespace lsp::providers::shutdown
return "ShutdownProvider"; return "ShutdownProvider";
} }
std::string ShutdownProvider::ProvideResponse(const protocol::RequestMessage& request, ProviderContext& context) std::string ShutdownProvider::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
{ {
spdlog::debug("ShutdownProvider: Providing response for method {}", request.method); spdlog::debug("ShutdownProvider: Providing response for method {}", request.method);

View File

@ -10,6 +10,6 @@ namespace lsp::providers::shutdown
std::string GetMethod() const override; std::string GetMethod() const override;
std::string GetProviderName() const override; std::string GetProviderName() const override;
std::string ProvideResponse(const protocol::RequestMessage& request, ProviderContext& context) override; std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
}; };
} }

View File

@ -14,7 +14,7 @@ namespace lsp::providers::text_document
return "CompletionProvider"; return "CompletionProvider";
} }
std::string CompletionProvider::ProvideResponse(const protocol::RequestMessage& request, ProviderContext& context) std::string CompletionProvider::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
{ {
static_cast<void>(context); static_cast<void>(context);
spdlog::debug("CompletionProvider: Providing response for method {}", request.method); spdlog::debug("CompletionProvider: Providing response for method {}", request.method);

View File

@ -14,7 +14,7 @@ namespace lsp::providers::text_document
std::string GetMethod() const override; std::string GetMethod() const override;
std::string GetProviderName() const override; std::string GetProviderName() const override;
std::string ProvideResponse(const protocol::RequestMessage& request, ProviderContext& context) override; std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
private: private:
// 构建完整的补全响应 // 构建完整的补全响应

View File

@ -14,7 +14,7 @@ namespace lsp::providers::text_document
return "DidChangeProvider"; return "DidChangeProvider";
} }
void DidChangeProvider::HandleNotification(const protocol::NotificationMessage& notification, ProviderContext& context) void DidChangeProvider::HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context)
{ {
static_cast<void>(context); static_cast<void>(context);
spdlog::debug("DidChangeProvider: Providing response for method {}", notification.method); spdlog::debug("DidChangeProvider: Providing response for method {}", notification.method);

View File

@ -9,6 +9,6 @@ namespace lsp::providers::text_document
DidChangeProvider() = default; DidChangeProvider() = default;
std::string GetMethod() const override; std::string GetMethod() const override;
std::string GetProviderName() const override; std::string GetProviderName() const override;
void HandleNotification(const protocol::NotificationMessage& notification, ProviderContext& context) override; void HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context) override;
}; };
} }

View File

@ -13,7 +13,7 @@ namespace lsp::providers::text_document
return "DidOpenProvider"; return "DidOpenProvider";
} }
void DidOpenProvider::HandleNotification(const protocol::NotificationMessage& notification, ProviderContext& context) void DidOpenProvider::HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context)
{ {
static_cast<void>(context); static_cast<void>(context);
spdlog::debug("DidOpenProvider: Providing response for method {}", notification.method); spdlog::debug("DidOpenProvider: Providing response for method {}", notification.method);

View File

@ -10,6 +10,6 @@ namespace lsp::providers::text_document
DidOpenProvider() = default; DidOpenProvider() = default;
std::string GetMethod() const override; std::string GetMethod() const override;
std::string GetProviderName() const override; std::string GetProviderName() const override;
void HandleNotification(const protocol::NotificationMessage& notification, ProviderContext& context) override; void HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context) override;
}; };
} }

View File

@ -13,7 +13,7 @@ namespace lsp::providers::set_trace
return "SetTraceProvider"; return "SetTraceProvider";
} }
void SetTraceProvider::HandleNotification(const protocol::NotificationMessage& notification, ProviderContext& context) void SetTraceProvider::HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context)
{ {
static_cast<void>(context); static_cast<void>(context);
spdlog::debug("SetTraceProvider: Providing response for method {}", notification.method); spdlog::debug("SetTraceProvider: Providing response for method {}", notification.method);

View File

@ -9,6 +9,6 @@ namespace lsp::providers::set_trace
SetTraceProvider() = default; SetTraceProvider() = default;
std::string GetMethod() const override; std::string GetMethod() const override;
std::string GetProviderName() const override; std::string GetProviderName() const override;
void HandleNotification(const protocol::NotificationMessage& notification, ProviderContext& context) override; void HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context) override;
}; };
} }