fix(pbs): keep editorial signatures in source syntax
Share frontend type and return presentation across hover, completion, signature help, outline and inferred hints. Preserve generic applications, source grouping, nominal origins and navigation. Add parser structure, real module/reexport, LSP mapping and Studio consumer regressions. Document the PBS editorial contract. WRK-0021 / DEC-0001 / PLN-0001. Full make -C tooling verify passed all 11 stages: tooling/build/runs/20261126T135036Z-bed847d1/manifest.json. Commit and push explicitly requested by the user.
This commit is contained in:
@@ -219,6 +219,51 @@ Rules:
|
||||
- Generated ordinal placeholders such as `arg0`, `arg1`, or equivalent names are internal implementation fallbacks only and MUST NOT be exposed as public parameter names.
|
||||
- If a user-visible callable lacks a real canonical parameter name, semantic metadata MUST represent that name as missing or unresolved rather than fabricating an ordinal placeholder.
|
||||
|
||||
### 3.2.1 Source presentation of callable signatures
|
||||
|
||||
The PBS frontend owns the source presentation shared by hover, completion,
|
||||
signature help, document symbols and inferred type hints. Consumers transport or
|
||||
render frontend labels; they MUST NOT reconstruct PBS types, repair type strings
|
||||
or perform independent generic substitution.
|
||||
|
||||
Complete type and return fragments MUST use accepted PBS source syntax:
|
||||
|
||||
- A result return with no success payload is `result<E>`.
|
||||
- A result return with a scalar payload is `result<E> T`; a named tuple payload
|
||||
remains `result<E> (left: T, right: U)` with its labels and order intact.
|
||||
- Optional values use `optional T`, including inside composed types.
|
||||
- Ordinary empty returns may be presented as `void`. Internal tuple/result
|
||||
normalization MUST NOT expose `unit`, `result<E, T>` or postfix `T?` as a
|
||||
replacement for these source forms.
|
||||
- Groups, function inputs/outputs, array elements and generic arguments MUST
|
||||
preserve their structure, precedence and ordered logical types.
|
||||
|
||||
Presentation MUST preserve nominal error/type identity, parameter names and
|
||||
order, tuple labels, generic arguments and declaration provenance. Unavailable
|
||||
parameter names remain unavailable rather than receiving generated ordinal names.
|
||||
Source recovery may expose an unknown marker or suppress a type hint; it MUST NOT
|
||||
invent a concrete type or present an unknown result payload as an empty payload.
|
||||
Recovery markers are not complete source fragments.
|
||||
|
||||
Surfaces may use context-appropriate compact forms rather than identical strings.
|
||||
Document symbols describe declarations. Hover and signature help for a resolved
|
||||
application expose its concrete types; symbolic declarations retain their type
|
||||
parameters. Completion may describe a declaration or known application as
|
||||
appropriate. This does not add generic argument inference: applications continue
|
||||
to follow the explicit-argument rules of the generic specifications.
|
||||
|
||||
Imports, aliases and reexports retain the existing canonical-name policy and
|
||||
nominal origins. Navigation MUST retain access to the original declaration even
|
||||
when a displayed application is specialized. A canonical name need not match the
|
||||
consumer's local alias; parseability of a fragment does not by itself establish
|
||||
name resolution in an arbitrary consumer namespace.
|
||||
|
||||
Conformance checks MUST reparse complete fragments in appropriate grammatical
|
||||
positions and verify their type structure and resolution/provenance. They MUST
|
||||
also exercise real module/barrel resolution and frontend-to-consumer transport,
|
||||
including parameter labels and the active parameter, without treating a compact
|
||||
label as a self-contained declaration.
|
||||
|
||||
### 3.3 Declaration validity
|
||||
|
||||
Rules:
|
||||
|
||||
Reference in New Issue
Block a user