6.0 KiB
6.0 KiB
| id | ticket | title | status | created | ref_decisions | tags | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| PLN-0080 | pbs-autocomplete-parameter-names | Propagate semantic parameter names to PBS LSP editor assistance | open | 2026-05-08 |
|
|
Briefing
DEC-0036 requires completion, signature help, and hover to consume callable parameter names from the compiler semantic model and prevents generated ordinal placeholders from reaching user-facing editor/LSP output.
This plan implements the LSP/editor consumption slice after compiler semantic callable metadata exists.
Objective
Propagate canonical semantic parameter names into PBS completion, signature help, hover, and VS Code-facing protocol mapping. Add tests proving arg0, arg1, and equivalent generated placeholders do not leak through user-facing LSP/editor surfaces.
Dependencies
- Depends on accepted decision
DEC-0036. - Should follow
PLN-0078for spec contract alignment. - Requires
PLN-0079or equivalent compiler semantic metadata before final acceptance.
Scope
- Update PBS editorial support outputs consumed by the LSP bridge.
- Update LSP baseline messages/mappers if the protocol shape needs richer parameter metadata.
- Update completion item construction to use semantic parameter names in labels/details/snippets.
- Update signature help to display semantic parameter names and types.
- Update hover signatures to use the same parameter identity.
- Update VS Code extension only if it formats snippets or signatures locally.
- Add LSP/protocol tests that reject
argNleakage.
Non-Goals
- No compiler semantic model implementation; that belongs to
PLN-0079. - No authored parameter prose documentation.
- No final design for optional/default/rest parameter UI unless already surfaced by compiler metadata.
- No UI-only guesswork for missing names.
Execution Method
-
Identify current LSP/editor assistance boundary:
- Inspect:
prometeu-lsp/prometeu-lsp-v1/src/main/java/p/studio/lsp/services/compiler/CompilerLanguageServiceBridge.javaprometeu-lsp/prometeu-lsp-v1/src/main/java/p/studio/lsp/services/LanguageServiceBridge.javaprometeu-lsp/prometeu-lsp-v1/src/main/java/p/studio/lsp/messages/BaselineCompletionItem.javaprometeu-lsp/prometeu-lsp-v1/src/main/java/p/studio/lsp/messages/BaselineSignature.javaprometeu-lsp/prometeu-lsp-v1/src/main/java/p/studio/lsp/messages/BaselineSignatureHelp.javaprometeu-lsp/prometeu-lsp-v1/src/main/java/p/studio/lsp/messages/BaselineHover.java
- Map which fields currently carry callable signatures and parameters.
- Inspect:
-
Consume semantic parameter names from compiler outputs:
- Update bridge/mapping code so completion/signature/hover surfaces use parameter names from PBS semantic callable metadata.
- Do not generate display names from method names, types, docs, or local maps.
- Treat missing semantic names as incomplete metadata and apply a non-misleading fallback UI that does not show
argN.
-
Update protocol mapping:
- Inspect:
prometeu-lsp/prometeu-lsp-v1/src/main/java/p/studio/lsp/services/protocol/mapping/Lsp4jProtocolMessageMapper.javaprometeu-lsp/prometeu-lsp-v1/src/main/java/p/studio/lsp/services/protocol/mapping/ProtocolMessageMapper.java
- Ensure LSP4J completion/signature/hover conversion preserves semantic parameter names.
- Ensure snippet placeholders, if emitted, use canonical parameter names.
- Inspect:
-
Update VS Code extension if required:
- Inspect:
tools/vscode-extension/src/extension.ts
- If the extension formats call snippets or signatures locally, remove any generated ordinal placeholders and consume protocol-provided semantic names.
- Inspect:
-
Add LSP/editor tests:
- Extend:
prometeu-lsp/prometeu-lsp-v1/src/test/java/p/studio/lsp/services/compiler/CompilerLanguageServiceBridgeTest.javaprometeu-lsp/prometeu-lsp-v1/src/test/java/p/studio/lsp/services/protocol/PrometeuTextDocumentServiceTest.javaprometeu-lsp/prometeu-lsp-v1/src/test/java/p/studio/lsp/services/protocol/PrometeuLanguageServerTest.java
- Assert completion labels/details/snippets do not contain
arg0orarg1. - Assert signature help parameter labels use semantic names.
- Assert hover callable signatures use the same semantic names.
- Extend:
Acceptance Criteria
- Completion surfaces use canonical semantic parameter names and do not leak
argN. - Signature help surfaces use canonical semantic parameter names and do not leak
argN. - Hover callable signatures use canonical semantic parameter names and do not leak
argN. - The same callable uses the same parameter names across completion, signature help, and hover.
- Missing parameter metadata is represented without fabricating public ordinal names.
- VS Code extension behavior remains compatible with protocol outputs.
Tests
- Run focused LSP tests:
CompilerLanguageServiceBridgeTestPrometeuTextDocumentServiceTestPrometeuLanguageServerTest
- Run the LSP Gradle test task for
prometeu-lsp-v1if available. - Run VS Code extension tests/build if the extension code changes:
npm testornpm run compileintools/vscode-extension, depending on available scripts.
- Run
discussion validate.
Affected Artifacts
prometeu-lsp/prometeu-lsp-v1/src/main/java/p/studio/lsp/services/compiler/CompilerLanguageServiceBridge.javaprometeu-lsp/prometeu-lsp-v1/src/main/java/p/studio/lsp/services/LanguageServiceBridge.javaprometeu-lsp/prometeu-lsp-v1/src/main/java/p/studio/lsp/messages/BaselineCompletionItem.javaprometeu-lsp/prometeu-lsp-v1/src/main/java/p/studio/lsp/messages/BaselineSignature.javaprometeu-lsp/prometeu-lsp-v1/src/main/java/p/studio/lsp/messages/BaselineSignatureHelp.javaprometeu-lsp/prometeu-lsp-v1/src/main/java/p/studio/lsp/messages/BaselineHover.javaprometeu-lsp/prometeu-lsp-v1/src/main/java/p/studio/lsp/services/protocol/mapping/Lsp4jProtocolMessageMapper.javatools/vscode-extension/src/extension.tsif local formatting is present.- LSP protocol and bridge tests.