Skip to content

fix(lsp): advertise only backed wright-lsp capabilities - #427

Merged
Teakowa merged 2 commits into
mainfrom
wright-421-backed-lsp-capabilities
Sep 29, 2026
Merged

Teakowa merged 2 commits into
mainfrom
wright-421-backed-lsp-capabilities

Conversation

@e54-bot

@e54-bot e54-bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Closes #421: wright-lsp now advertises and reports only behavior the implementation actually backs.

  • initialize advertises only textDocumentSync (full sync) + UTF-16 position encoding; the unbacked hover/definition/references/completion/rename/semanticTokens provider entries and their adapter handlers are removed. Unadvertised or unknown requests uniformly return result: null and the server keeps running.
  • wright-language no longer fabricates an error for every document: LanguageService::diagnostics reports source-provider-unavailable only 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-read Analysis/SourceError/SourceFile surface, and the now-unused wright-analyzer/serde_json/libc dependencies are removed with the unbacked capability path.
  • docs/language-services.md, README.md, and docs/v1-matrix.md state 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_capabilities asserts all six unbacked provider entries are absent (re-adding hoverProvider: true fails it).
  • workshop_lsp_workflow_keeps_protocol_and_lifecycle_contracts asserts a valid .ws document publishes an empty diagnostics array (restoring the unconditional diagnostic fails it) and that textDocument/hover returns a null result with the server surviving to shutdown.
  • opy_lsp_workflow_reports_provider_boundary_without_static_fallback asserts .opy still publishes source-provider-unavailable and unadvertised textDocument/completion returns null.
  • wright-language tests cover .opy/.ostw/.del refusal and empty .ws diagnostics.

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

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 e54-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Teakowa
Teakowa merged commit 9ad16c2 into main Sep 29, 2026
22 checks passed
@Teakowa
Teakowa deleted the wright-421-backed-lsp-capabilities branch September 29, 2026 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Advertise only backed wright-lsp capabilities and declare the LSP support scope

2 participants