fix(lsp): advertise only backed wright-lsp capabilities - #427
Conversation
wright-lsp advertised hover, definition, references, completion, rename, and semantic tokens while wright-language stubbed every one of them, and every document — including raw Workshop — received a source-provider-unavailable error. The initialize result now advertises only document synchronization; unadvertised requests return a uniform null result, source-language documents keep the explicit provider refusal, and other documents publish no diagnostics. The dead service stubs, unreachable adapter handlers, and unused wright-language dependencies are removed with the unbacked surface. Fixes #421 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
e54-bot
left a comment
There was a problem hiding this comment.
Changes needed: docs/language-services.md "Current LSP scope" (added lines ~793-797) still describes behavior the code does not implement.
It says publishDiagnostics has "per-root publication ownership" and that "affected documents are republished on include/overlay changes". LanguageService::dependent_documents (crates/wright-language/src/service.rs, ~line 50) returns only the changed URI. There is no include or overlay dependency tracking left, and each source document yields at most one diagnostic. No test covers include/overlay republication.
This breaks the Issue review check ("docs/language-services.md and the README describe no LSP capability that the current code does not implement").
Correction: remove the include/overlay republication claim and the "source that disappears from a root analysis is retired" claim from that bullet. Keep versioned diagnostics, grouping by source identity, and didClose cleanup.
Verified at 86ca36a in a separate worktree: cargo fmt --check, cargo clippy -p wright-language -p wright-lsp --all-targets -D warnings and cargo test -p wright-language -p wright-lsp pass. I did not run the full workspace gates.
Summary
Closes #421:
wright-lspnow advertises and reports only behavior the implementation actually backs.initializeadvertises onlytextDocumentSync(full sync) + UTF-16 position encoding; the unbackedhover/definition/references/completion/rename/semanticTokensprovider entries and their adapter handlers are removed. Unadvertised or unknown requests uniformly returnresult: nulland the server keeps running.wright-languageno longer fabricates an error for every document:LanguageService::diagnosticsreportssource-provider-unavailableonly for source-language documents (.opy/.del/.ostw) while a provider capability is unnegotiated; raw Workshop and other documents publish no diagnostics. The dead query stubs (hover,definition,references,completion,rename,semantic_tokens), the never-readAnalysis/SourceError/SourceFilesurface, and the now-unusedwright-analyzer/serde_json/libcdependencies are removed with the unbacked capability path.docs/language-services.md,README.md, anddocs/v1-matrix.mdstate the current LSP scope (lifecycle + document sync + the diagnostics boundary) and mark provider-backed editor features as future work (Wire provider-driven mutation through Wright product surfaces #156).Test plan
initialize_advertises_only_backed_capabilitiesasserts all six unbacked provider entries are absent (re-addinghoverProvider: truefails it).workshop_lsp_workflow_keeps_protocol_and_lifecycle_contractsasserts a valid.wsdocument publishes an empty diagnostics array (restoring the unconditional diagnostic fails it) and thattextDocument/hoverreturns a null result with the server surviving toshutdown.opy_lsp_workflow_reports_provider_boundary_without_static_fallbackasserts.opystill publishessource-provider-unavailableand unadvertisedtextDocument/completionreturns null.wright-languagetests cover.opy/.ostw/.delrefusal and empty.wsdiagnostics.Verification:
cargo fmt --all -- --check,cargo clippy --workspace --all-targets --all-features -- -D warnings,cargo test --workspace --all-targets --all-features(all green),git diff --check.Generated with Devin