Files
tsl-devkit/lsp-server/src/manager/bootstrap.cppm
T
csh 09e65224fe 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
2025-12-24 10:42:13 +08:00

56 lines
1.7 KiB
C++

module;
export module lsp.manager.bootstrap;
import spdlog;
import std;
import lsp.manager.manager_hub;
import lsp.scheduler.async_executor;
import lsp.utils.args_parser;
export namespace lsp::manager::bootstrap
{
void InitializeManagerHub(
ManagerHub& hub,
scheduler::AsyncExecutor& async_executor,
const std::vector<std::string>& system_lib_paths);
}
namespace lsp::manager::bootstrap
{
void InitializeManagerHub(
ManagerHub& hub,
scheduler::AsyncExecutor& async_executor,
const std::vector<std::string>& system_lib_paths)
{
spdlog::info("Initializing manager hub...");
for (const auto& path : system_lib_paths)
{
std::string task_name = std::format("Load system library: {}", path);
async_executor.Submit(
task_name,
[&hub, path]() -> std::optional<std::string> {
try
{
hub.symbols().LoadSystemLibrary(path);
return std::format("Loaded system library: {}", path);
}
catch (const std::exception& e)
{
spdlog::error("Failed to load system library {}: {}", path, e.what());
throw;
}
},
[path](const std::optional<std::string>& result, bool cancelled) {
if (cancelled)
spdlog::info("System library load task cancelled: {}", path);
else if (result)
spdlog::info("{}", *result);
});
}
spdlog::info("Manager hub initialized, system library loading in background");
}
}