lsp-server first commit

This commit is contained in:
csh
2025-06-23 20:29:48 +08:00
parent cbcff7d1b4
commit 4f5bf9d781
43 changed files with 1851 additions and 11 deletions
@@ -0,0 +1,37 @@
#include "./set_trace_provider.hpp"
namespace lsp::providers::trace
{
nlohmann::json SetTraceProvider::ProvideResponse(const LspRequest& request)
{
try
{
auto params = request.params;
if (params.contains("value"))
{
std::string trace_value = params["value"];
// 这里可以设置跟踪级别
// 例如:设置全局跟踪变量
}
}
catch (const std::exception& e)
{
// 处理错误
}
// 通知不需要响应
return nlohmann::json();
}
inline std::string SetTraceProvider::GetMethod() const
{
return "$/setTrace";
}
inline std::string SetTraceProvider::GetProviderName() const
{
return "SetTraceProvider";
}
}