Repository navigation
Open
Description
Summary
Migrate the Interactive Shell's tab completion from the current Pseudoterminal-based fallback to VS Code's native TerminalCompletionProvider API, which provides an IntelliSense-style popup in terminals.
Blocked by: microsoft/vscode#224505 — the TerminalCompletionProvider API is proposed as of April 2026. It was briefly finalized then reverted due to API shape feedback.
Background
PR #576 implemented a self-contained tab completion fallback directly in the Pseudoterminal (bash/zsh-style multi-column picker). This works well but has limitations compared to VS Code's native terminal suggest:
- No IntelliSense-style popup with icons, documentation, and keyboard navigation
- No trigger-on-type (
.and space) — requires explicit Tab press - Manual ANSI rendering instead of VS Code's native UI
What to Implement When the API Finalizes
Completion Triggers and Suggestions
| Trigger | Suggestions | Data Source |
|---|---|---|
| Empty line | show, use, exit, quit, cls, help, it, db |
Static list |
show |
dbs, databases, collections |
Static list |
use |
Known database names | SchemaStore or ClustersClient |
db. |
Known collection names + database methods | SchemaStore + ClustersClient + documentdb-shell-api-types |
db.<collection>. |
Method names (find, insertOne, etc.) |
documentdb-shell-api-types |
db.<collection>.find({}). |
Cursor methods (limit, skip, sort, etc.) |
documentdb-shell-api-types |
db.<collection>.find({ |
Field names from schema | SchemaStore |
Inside { $ |
DocumentDB API query operators | documentdb-constants |
Implementation Steps
- Check the final API shape for
TerminalCompletionProvider - Add to
enabledApiProposalsinpackage.jsonif needed - Create a new provider that reuses
ShellCompletionProvider's context detection and data sources - Map
CompletionCandidateto VS Code'sTerminalCompletionItem(add icons, documentation, sort order) - Register with trigger characters
.and(space) - Filter to DocumentDB shell terminals only (match terminal name or profile)
- Optionally remove the ANSI fallback picker (
ShellCompletionRenderer) and Tab key override - Consider keeping ghost text (
ShellGhostText) or replacing with VS Code's native inline suggestions
Reusable Components
The existing ShellCompletionProvider (context detection + candidate generation) is platform-neutral and can be reused directly. Only the rendering layer changes.
References
- VS Code tracking issue: microsoft/vscode#224505
- Current fallback implementation: PR #576
- Architecture docs:
docs/ai-and-plans/interactive-shell/9-shell-autocompletion.md
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
- StatusShow more project fieldsBlocked
Activity
docs: add shell autocompletion plan and update future work