feat(lsp_server): implement missing providers and json coverage

Implement workspace configuration/folders and apply WorkspaceEdit.changes.

Strengthen provider JSON coverage (all methods require params, no errors).

Verified: Release test_provider
This commit is contained in:
csh
2025-12-24 10:42:13 +08:00
parent f6943e69ef
commit 09e65224fe
93 changed files with 14203 additions and 856 deletions
+10 -9
View File
@@ -1,8 +1,5 @@
module;
#include <spdlog/sinks/basic_file_sink.h>
#include <spdlog/sinks/stdout_sinks.h>
export module lsp.utils.args_parser;
import spdlog;
@@ -55,6 +52,10 @@ namespace lsp::utils
// Default to stderr so LSP stdio (stdout) stays clean.
config_.use_stderr = true;
constexpr std::string_view kLogFilePrefix = "--log-file=";
constexpr std::string_view kThreadsPrefix = "--threads=";
constexpr std::string_view kInterpreterPrefix = "--interpreter=";
for (int i = 1; i < argc; ++i)
{
std::string arg = argv[i];
@@ -81,18 +82,18 @@ namespace lsp::utils
config_.use_stderr = true;
else if (arg == "--log-stdout")
config_.use_stderr = false;
else if (arg.find("--log-file=") == 0)
config_.log_file = arg.substr(std::strlen("--log-file="));
else if (arg.starts_with(kLogFilePrefix))
config_.log_file = arg.substr(kLogFilePrefix.size());
else if (arg == "--use-stdio")
config_.use_stderr = true;
else if (arg.find("--threads=") == 0)
else if (arg.starts_with(kThreadsPrefix))
{
auto value = arg.substr(std::strlen("--threads="));
auto value = arg.substr(kThreadsPrefix.size());
config_.thread_count = std::max<std::size_t>(1, static_cast<std::size_t>(std::stoi(value)));
}
else if (arg.find("--interpreter=") == 0)
else if (arg.starts_with(kInterpreterPrefix))
{
config_.interpreter_path = arg.substr(std::strlen("--interpreter="));
config_.interpreter_path = arg.substr(kInterpreterPrefix.size());
}
}