🐛 fix(core): enable syntax diagnostics
This commit is contained in:
@@ -14,7 +14,6 @@ import lsp.manager.bootstrap;
|
||||
import lsp.manager.events;
|
||||
import lsp.manager.manager_hub;
|
||||
import lsp.protocol;
|
||||
import lsp.provider.manifest;
|
||||
import lsp.scheduler.async_executor;
|
||||
import lsp.utils.text_coordinates;
|
||||
|
||||
@@ -157,26 +156,18 @@ namespace lsp::core
|
||||
std::ostream& output,
|
||||
ProviderRegistrar registrar,
|
||||
std::size_t concurrency,
|
||||
std::string interpreter_path)
|
||||
: input_(input),
|
||||
output_(output),
|
||||
manager_hub_(),
|
||||
async_executor_(concurrency),
|
||||
dispatcher_(async_executor_, manager_hub_),
|
||||
interpreter_path_(std::move(interpreter_path))
|
||||
std::string interpreter_path) : input_(input),
|
||||
output_(output),
|
||||
manager_hub_(),
|
||||
async_executor_(concurrency),
|
||||
dispatcher_(async_executor_, manager_hub_),
|
||||
interpreter_path_(std::move(interpreter_path))
|
||||
{
|
||||
spdlog::info("Initializing LSP server with {} worker threads", concurrency);
|
||||
|
||||
InitializeManagerHub();
|
||||
RegisterProviders(std::move(registrar));
|
||||
if (provider::kEnableDiagnosticsPublisher)
|
||||
{
|
||||
RegisterDiagnosticsPublisher();
|
||||
}
|
||||
else
|
||||
{
|
||||
spdlog::debug("Diagnostics publisher disabled (staged rollout)");
|
||||
}
|
||||
RegisterDiagnosticsPublisher();
|
||||
|
||||
spdlog::debug("LSP server initialized with {} providers.",
|
||||
dispatcher_.GetAllSupportedMethods().size());
|
||||
@@ -701,7 +692,7 @@ namespace lsp::core
|
||||
}
|
||||
|
||||
manager::bootstrap::InitializeManagerHub(
|
||||
manager_hub_, async_executor_, {funcext_path.string()});
|
||||
manager_hub_, async_executor_, { funcext_path.string() });
|
||||
}
|
||||
|
||||
void LspServer::RegisterProviders(ProviderRegistrar registrar)
|
||||
|
||||
@@ -15,78 +15,8 @@ import lsp.provider.text_document.did_open;
|
||||
import lsp.provider.text_document.completion;
|
||||
import lsp.provider.trace.set_trace;
|
||||
|
||||
// NOTE: keep other providers implemented but disabled.
|
||||
// Uncomment when re-enabling additional capabilities.
|
||||
// import lsp.provider.call_hierarchy.incoming_calls;
|
||||
// import lsp.provider.call_hierarchy.outgoing_calls;
|
||||
// import lsp.provider.client.register_capability;
|
||||
// import lsp.provider.client.unregister_capability;
|
||||
// import lsp.provider.code_action.resolve;
|
||||
// import lsp.provider.code_lens.resolve;
|
||||
// import lsp.provider.document_link.resolve;
|
||||
// import lsp.provider.inlay_hint.resolve;
|
||||
// import lsp.provider.telemetry.event;
|
||||
// import lsp.provider.text_document.code_action;
|
||||
// import lsp.provider.text_document.code_lens;
|
||||
// import lsp.provider.text_document.color_presentation;
|
||||
// import lsp.provider.text_document.diagnostic;
|
||||
// import lsp.provider.text_document.document_color;
|
||||
// import lsp.provider.text_document.document_highlight;
|
||||
// import lsp.provider.text_document.document_link;
|
||||
// import lsp.provider.text_document.document_symbol;
|
||||
// import lsp.provider.text_document.folding_range;
|
||||
// import lsp.provider.text_document.formatting;
|
||||
// import lsp.provider.text_document.hover;
|
||||
// import lsp.provider.text_document.implementation;
|
||||
// import lsp.provider.text_document.inlay_hint;
|
||||
// import lsp.provider.text_document.inline_value;
|
||||
// import lsp.provider.text_document.linked_editing_range;
|
||||
// import lsp.provider.text_document.moniker;
|
||||
// import lsp.provider.text_document.on_type_formatting;
|
||||
// import lsp.provider.text_document.prepare_call_hierarchy;
|
||||
// import lsp.provider.text_document.prepare_rename;
|
||||
// import lsp.provider.text_document.prepare_type_hierarchy;
|
||||
// import lsp.provider.text_document.publish_diagnostics;
|
||||
// import lsp.provider.text_document.range_formatting;
|
||||
// import lsp.provider.text_document.references;
|
||||
// import lsp.provider.text_document.rename;
|
||||
// import lsp.provider.text_document.selection_range;
|
||||
// import lsp.provider.text_document.semantic_tokens;
|
||||
// import lsp.provider.text_document.signature_help;
|
||||
// import lsp.provider.text_document.type_definition;
|
||||
// import lsp.provider.type_hierarchy.subtypes;
|
||||
// import lsp.provider.type_hierarchy.supertypes;
|
||||
// import lsp.provider.window.log_message;
|
||||
// import lsp.provider.window.show_document;
|
||||
// import lsp.provider.window.show_message;
|
||||
// import lsp.provider.window.show_message_request;
|
||||
// import lsp.provider.window.work_done_progress_create;
|
||||
// import lsp.provider.workspace.apply_edit;
|
||||
// import lsp.provider.workspace.code_lens_refresh;
|
||||
// import lsp.provider.workspace.configuration;
|
||||
// import lsp.provider.workspace.diagnostic;
|
||||
// import lsp.provider.workspace.did_change_configuration;
|
||||
// import lsp.provider.workspace.did_change_watched_files;
|
||||
// import lsp.provider.workspace.did_change_workspace_folders;
|
||||
// import lsp.provider.workspace.did_create_files;
|
||||
// import lsp.provider.workspace.did_delete_files;
|
||||
// import lsp.provider.workspace.did_rename_files;
|
||||
// import lsp.provider.workspace.diagnostic_refresh;
|
||||
// import lsp.provider.workspace.execute_command;
|
||||
// import lsp.provider.workspace.inlay_hint_refresh;
|
||||
// import lsp.provider.workspace.inline_value_refresh;
|
||||
// import lsp.provider.workspace.semantic_tokens_refresh;
|
||||
// import lsp.provider.workspace.symbol;
|
||||
// import lsp.provider.workspace.workspace_folders;
|
||||
// import lsp.provider.workspace.will_create_files;
|
||||
// import lsp.provider.workspace.will_delete_files;
|
||||
// import lsp.provider.workspace.will_rename_files;
|
||||
// import lsp.provider.workspace_symbol.resolve;
|
||||
|
||||
export namespace lsp::provider
|
||||
{
|
||||
inline constexpr bool kEnableDiagnosticsPublisher = false;
|
||||
|
||||
using AllProviders = ProviderRegistry<
|
||||
completion_item::Resolve,
|
||||
Initialize,
|
||||
@@ -96,88 +26,7 @@ export namespace lsp::provider
|
||||
text_document::DidChange,
|
||||
text_document::DidClose,
|
||||
text_document::DidOpen,
|
||||
SetTrace
|
||||
>;
|
||||
|
||||
// Full provider registry (kept commented for quick re-enable during staged rollout):
|
||||
// using AllProviders = ProviderRegistry<
|
||||
// call_hierarchy::IncomingCalls,
|
||||
// call_hierarchy::OutgoingCalls,
|
||||
// client::RegisterCapability,
|
||||
// client::UnregisterCapability,
|
||||
// code_action::Resolve,
|
||||
// code_lens::Resolve,
|
||||
// completion_item::Resolve,
|
||||
// document_link::Resolve,
|
||||
// Initialize,
|
||||
// Initialized,
|
||||
// inlay_hint::Resolve,
|
||||
// telemetry::Event,
|
||||
// text_document::CodeAction,
|
||||
// text_document::CodeLens,
|
||||
// text_document::ColorPresentation,
|
||||
// text_document::Completion,
|
||||
// text_document::Definition,
|
||||
// text_document::Diagnostic,
|
||||
// text_document::DidChange,
|
||||
// text_document::DidClose,
|
||||
// text_document::DidOpen,
|
||||
// text_document::DocumentColor,
|
||||
// text_document::DocumentHighlight,
|
||||
// text_document::DocumentLink,
|
||||
// text_document::DocumentSymbol,
|
||||
// text_document::FoldingRange,
|
||||
// text_document::Formatting,
|
||||
// text_document::Hover,
|
||||
// text_document::Implementation,
|
||||
// text_document::InlayHint,
|
||||
// text_document::InlineValue,
|
||||
// text_document::LinkedEditingRange,
|
||||
// text_document::Moniker,
|
||||
// text_document::OnTypeFormatting,
|
||||
// text_document::PrepareCallHierarchy,
|
||||
// text_document::PrepareRename,
|
||||
// text_document::PrepareTypeHierarchy,
|
||||
// text_document::PublishDiagnostics,
|
||||
// text_document::RangeFormatting,
|
||||
// text_document::References,
|
||||
// text_document::Rename,
|
||||
// text_document::SelectionRange,
|
||||
// text_document::SemanticTokensRange,
|
||||
// text_document::SemanticTokensFull,
|
||||
// text_document::SemanticTokensFullDelta,
|
||||
// text_document::SignatureHelp,
|
||||
// text_document::TypeDefinition,
|
||||
// SetTrace,
|
||||
// type_hierarchy::Subtypes,
|
||||
// type_hierarchy::Supertypes,
|
||||
// window::LogMessage,
|
||||
// window::ShowDocument,
|
||||
// window::ShowMessage,
|
||||
// window::ShowMessageRequest,
|
||||
// window::WorkDoneProgressCreate,
|
||||
// workspace::ApplyEdit,
|
||||
// workspace::CodeLensRefresh,
|
||||
// workspace::Configuration,
|
||||
// workspace::Diagnostic,
|
||||
// workspace::DidChangeConfiguration,
|
||||
// workspace::DidChangeWatchedFiles,
|
||||
// workspace::DidChangeWorkspaceFolders,
|
||||
// workspace::DidCreateFiles,
|
||||
// workspace::DidDeleteFiles,
|
||||
// workspace::DidRenameFiles,
|
||||
// workspace::DiagnosticRefresh,
|
||||
// workspace::ExecuteCommand,
|
||||
// workspace::InlayHintRefresh,
|
||||
// workspace::InlineValueRefresh,
|
||||
// workspace::SemanticTokensRefresh,
|
||||
// workspace::Symbol,
|
||||
// workspace::WorkspaceFolders,
|
||||
// workspace::WillCreateFiles,
|
||||
// workspace::WillDeleteFiles,
|
||||
// workspace::WillRenameFiles,
|
||||
// workspace_symbol::Resolve
|
||||
// >;
|
||||
SetTrace>;
|
||||
|
||||
static_assert(AllProviders::kProviderCount > 0, "No providers registered.");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user