implements PLN-0107

This commit is contained in:
2026-07-15 09:40:13 +01:00
parent 6fdb4828c3
commit 6cd24bf14f
8 changed files with 423 additions and 4 deletions
@@ -241,7 +241,37 @@ At minimum, each provider MUST expose:
2. `compiler()`, returning the compiler-facing frontend service used by the shared build pipeline;
3. `languageService()`, returning an optional editor-facing language-service capability for tooling consumers.
`languageService()` MUST be optional. A frontend that supports compilation but does not provide editor services MUST remain a valid provider.
`compiler()` is the only required executable frontend capability. It MUST be sufficient for `analyze`, `compile`, `build`, and backend-facing pipeline flows.
`languageService()` MUST be optional. A frontend that supports compilation but does not provide editor services MUST remain a valid provider. Absence of `languageService()` MUST NOT prevent project analysis, compilation, backend lowering, bytecode emission, verification, or artifact writing.
The first shared editor-facing contract SHOULD remain an aggregated language-service capability surface. The common compiler contract MUST NOT require separate top-level service interfaces for each editor feature until a future accepted decision and plan identify a real lifecycle, ownership, or testing boundary that requires that split.
When exposed, editor-facing capabilities MAY include:
1. diagnostics intended for live editor sessions,
2. completion,
3. hover,
4. definition and navigation,
5. signature help,
6. semantic tokens for a live document,
7. formatting,
8. rename,
9. code actions,
10. and other host-facing editor assistance.
These capabilities are optional unless a future frontend- or host-specific decision makes one of them mandatory for a narrower surface. Tooling consumers MUST query capability availability before invoking editor-specific behavior.
Absent editor capabilities MUST have deterministic fallback behavior at tooling boundaries:
1. collection-shaped responses SHOULD be empty;
2. scalar optional responses SHOULD be absent or use a documented neutral response;
3. host protocols that can represent unsupported operations SHOULD do so explicitly;
4. and absent editor capability MUST NOT be reported as a compiler failure.
Compiler diagnostics and editor diagnostics are distinct ownership surfaces. Diagnostics returned by `analyze`, `compile`, and `build` are compiler contract output. Editor diagnostics MAY reuse compiler analysis results, live overlays, caches, or cancellation-aware tooling state, but a frontend MUST NOT be required to provide editor diagnostics in order to compile.
`FrontendSpec` remains the source of static frontend-owned presentation metadata such as semantic vocabularies, host projections, and visual themes. Producing semantic tokens for a live document is an optional editor-facing capability; the existence of static presentation metadata MUST NOT imply that every frontend can provide live semantic-token results.
The frontend registry MUST resolve providers by `languageId`. A lookup for an unknown `languageId` MUST fail explicitly with a diagnostic-friendly error. Unknown languages MUST NOT silently fall back to PBS or to any other frontend.