🐛 fix(lsp_server): disable diagnostics publishing by default

This commit is contained in:
csh 2025-12-24 13:45:35 +08:00
parent ec2c580a8c
commit d13b24a5da
3 changed files with 11 additions and 2 deletions

View File

@ -94,7 +94,14 @@ namespace lsp::core
InitializeManagerHub();
RegisterProviders();
RegisterDiagnosticsPublisher();
if (provider::kEnableDiagnosticsPublisher)
{
RegisterDiagnosticsPublisher();
}
else
{
spdlog::debug("Diagnostics publisher disabled (staged rollout)");
}
spdlog::debug("LSP server initialized with {} providers.", dispatcher_.GetAllSupportedMethods().size());
}

View File

@ -88,6 +88,8 @@ import lsp.provider.trace.set_trace;
export namespace lsp::provider
{
inline constexpr bool kEnableDiagnosticsPublisher = false;
using AllProviders = ProviderRegistry<
completion_item::Resolve,
Initialize,

View File

@ -324,7 +324,7 @@ namespace lsp::test::provider
auto expected = FindPosition(content, "function UnitFunc", false);
assertTrue(location.range.start.line == expected.line, "Definition should resolve in document");
assertTrue(saw_diagnostics, "Server should publish diagnostics after didOpen");
assertTrue(!saw_diagnostics, "Server should not publish diagnostics during staged rollout");
assertTrue(!by_id["5"].error.has_value(), "Shutdown response should not contain error");
return result;
}