Lock DSC-0066 on Q1-A and Q2-A. Retire AGD-0048 through AGD-0056 into AGD-0069, DEC-0058, and PLN-0137. Published editor diagnostics use the bound frontend language id as source. For PBS that is pbs. The stable compiler code stays in code and is not copied into source. Related locations, phase, and repair payload stay unpublished.
63 lines
2.2 KiB
Markdown
63 lines
2.2 KiB
Markdown
---
|
|
id: AGD-0049
|
|
ticket: pbs-lsp-import-assistance
|
|
title: PBS LSP Import Assistance
|
|
status: abandoned
|
|
created: 2026-07-15
|
|
resolved:
|
|
decision:
|
|
tags: [studio, lsp, vscode, compiler-pbs, editor, imports, completion]
|
|
---
|
|
|
|
## Pain
|
|
|
|
Domain owner: `studio/lsp`
|
|
|
|
PBS users do not get import-aware assistance, so discovering exported symbols and adding the right import from barrels, stdlib, or project modules remains manual.
|
|
|
|
## Context
|
|
|
|
Completion already exists for local/editorial contexts, and stdlib imports are understood by the compiler pipeline. The LSP does not yet provide auto-import completion, organize imports, or import quick fixes.
|
|
|
|
## Open Questions
|
|
|
|
- [ ] Should auto-import target project modules, stdlib modules, or both in the first wave?
|
|
- [ ] How should barrels and explicit module imports be ranked and rendered in completion?
|
|
- [ ] Should organize imports be a code action, source action, formatter responsibility, or separate feature?
|
|
|
|
## Options
|
|
|
|
### Option A - Import completion only
|
|
|
|
- **Approach:** Suggest symbols from known modules and include import detail, but do not edit imports automatically.
|
|
- **Pro:** Low risk and improves discovery.
|
|
- **Con:** Still leaves manual import edits.
|
|
- **Maintainability:** Good as a stepping stone.
|
|
|
|
### Option B - Auto-import and organize imports
|
|
|
|
- **Approach:** Completion/code actions insert missing imports and source actions sort/remove unused imports.
|
|
- **Pro:** Matches modern editor expectations.
|
|
- **Con:** Requires robust module export indexing and edit placement rules.
|
|
- **Maintainability:** Strong if built on a proper import graph.
|
|
|
|
## Tradeoffs
|
|
|
|
Auto-import depends on knowing canonical exports and choosing an edit location. Doing that ad hoc in completion would create formatting and duplicate import issues.
|
|
|
|
## Recommendation
|
|
|
|
Prefer Option B as the target, but start with import-aware suggestions plus a limited missing-import quick fix.
|
|
|
|
## Discussion
|
|
|
|
This should be coordinated with code actions and formatter.
|
|
|
|
## Resolution
|
|
|
|
Aposentada em 2026-09-22. O tema foi consolidado em [AGD-0069](AGD-0069-pbs-lsp-remaining-editor-surface.md) / DSC-0066. Este texto não é normativo.
|
|
|
|
## Next Step
|
|
|
|
Decide first-wave import sources: stdlib only, project modules only, or both.
|