4.0 KiB
4.0 KiB
| id | ticket | title | status | created | ref_decisions | tags | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| PLN-0109 | multi-frontend-compiler-vs-language-services | Make LSP editorial calls capability aware | open | 2026-07-15 |
|
|
Briefing
DEC-0041 requires LSP and Studio consumers to query editorial capability availability before invoking editor-specific behavior. The current LSP bridge still contains PBS-specific editorial logic. This plan migrates LSP editorial calls to capability-aware provider lookup and graceful fallbacks.
Objective
Make LSP completion, hover, signature help, semantic tokens, and future editorial calls resolve the active frontend provider, consult optional language-service capabilities, and return deterministic neutral responses when capabilities are absent.
Dependencies
- Accepted decision:
DEC-0041. PLN-0108should expose PBS editor assistance throughFrontendProvider.languageService().- Existing
FrontendRegistryServicefrontend lookup. - Existing LSP baseline messages and tests.
Scope
- Update LSP bridge code to resolve frontend providers rather than hard-coding PBS editorial paths.
- Add fallback behavior for absent completion, hover, signature help, and semantic token capability.
- Preserve compiler-backed diagnostics through analyze/build paths.
- Keep PBS editorial behavior stable when its language service is present.
- Document or encode unsupported/neutral responses according to existing LSP baseline message shapes.
Non-Goals
- Add new LSP features.
- Change VSCode extension behavior beyond consuming existing baseline responses.
- Remove all PBS-specific code in one step if adapter compatibility still requires local mapping.
- Make semantic presentation metadata optional; only live semantic token production is optional.
Execution Method
- Inspect
prometeu-lsp/prometeu-lsp-v1/src/main/java/p/studio/lsp/services/compiler/CompilerLanguageServiceBridge.javaand identify all direct PBS editorial calls. - Add a provider-resolution path using
FrontendRegistryServiceor the existing registry abstraction forcontext.languageId(). - For each editorial endpoint, query
provider.languageService()and then the relevant capability before invoking implementation behavior. - Return neutral fallbacks when absent:
- completion: incomplete
falsewith empty items; - hover: absent/neutral hover content according to current baseline message constraints;
- signature help: empty signatures with stable active indices;
- semantic tokens: frontend legend/presentation where available and empty token list when live tokenization is absent.
- completion: incomplete
- Keep
analyzeDocumentcompiler-diagnostic behavior on the compiler pipeline and do not requirelanguageService(). - Update tests to cover both PBS-present and capability-absent frontends.
Acceptance Criteria
- LSP editorial endpoints do not assume every compiler frontend has editor assistance.
- Absent editorial capabilities produce deterministic empty or neutral responses, not compiler failures.
- Compiler diagnostics still work without a language service.
- PBS editor assistance remains unchanged when PBS language service is available.
- Any remaining PBS-specific code is adapter-local and documented as temporary if not removed.
Tests
- Add LSP tests for a compile-only frontend or stub provider with no language service.
- Preserve existing
CompilerLanguageServiceBridgeTestcoverage for PBS completion, hover, signature help, and semantic tokens. - Add regression coverage that
analyzeDocumentreturns compiler diagnostics independently of editorial services. - Run targeted LSP module tests.
Affected Artifacts
prometeu-lsp/prometeu-lsp-v1/src/main/java/p/studio/lsp/services/compiler/CompilerLanguageServiceBridge.javaprometeu-lsp/prometeu-lsp-v1/src/test/java/p/studio/lsp/services/compiler/CompilerLanguageServiceBridgeTest.java- LSP baseline message types only if neutral response representation is currently insufficient.
- Frontend registry integration points used by LSP.