♻️ 重构
This commit is contained in:
@@ -14,26 +14,25 @@ namespace lsp::provider
|
||||
return "SetTrace";
|
||||
}
|
||||
|
||||
void SetTrace::HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context)
|
||||
void SetTrace::HandleNotification(const protocol::NotificationMessage& notification, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
static_cast<void>(context);
|
||||
spdlog::debug("SetTraceProvider: Providing response for method {}", 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)
|
||||
{
|
||||
spdlog::set_level(spdlog::level::info);
|
||||
spdlog::info("SetTrace: Tacing disabled");
|
||||
spdlog::debug("Trace level set to off");
|
||||
}
|
||||
else if (params.value == protocol::TraceValueLiterals::Messages)
|
||||
{
|
||||
spdlog::set_level(spdlog::level::debug);
|
||||
spdlog::info("SetTrace: Tacing enabled (message only)");
|
||||
spdlog::debug("Trace level set to debug (messages)");
|
||||
}
|
||||
else if (params.value == protocol::TraceValueLiterals::Verbose)
|
||||
{
|
||||
spdlog::set_level(spdlog::level::trace);
|
||||
spdlog::info("SetTrace: Tacing enabled (verbose)");
|
||||
spdlog::debug("Trace level set to trace (verbose)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user