--- id: AGD-0049 ticket: pbs-lsp-import-assistance title: PBS LSP Import Assistance status: open 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 Ainda em aberto. ## Next Step Decide first-wave import sources: stdlib only, project modules only, or both.