Auto Import PlusFast workspace-wide auto-import suggestions for TypeScript / JavaScript / Python / Java, powered by a native Rust indexer. Designed for large monorepos where built-in IntelliSense is slow or misses third-party library exports. Why
Auto Import Plus builds a small native Rust daemon for your OS on first activation. The daemon indexes your entire workspace and its 3rd-party libraries (node_modules, Python site-packages) into a compact symbol table, then serves suggestions in 1–2 ms per keystroke. Features
Supported import shapes
InstallationFrom marketplace (when published)Search for "Auto Import Plus" in the VS Code extensions view. From a
|
| Setting | Default | Description |
|---|---|---|
autoImport.languages |
[typescript, javascript, python, java] |
Which languages to offer auto-imports for |
autoImport.minPrefixLength |
1 |
Minimum typed-prefix length before suggestions appear |
autoImport.maxResults |
20 |
Top-N suggestions to return |
autoImport.excludeGlobs |
**/node_modules/**, **/.venv/**, **/venv/**, … |
Paths excluded from the workspace scan (libraries are scanned separately) |
autoImport.libraries.enabled |
true |
Master switch for library indexing |
autoImport.libraries.tsNodeModules |
true |
Parse TS/JS dependencies from node_modules |
autoImport.libraries.pythonSitePackages |
true |
Auto-discover .venv / venv / env / .env site-packages |
autoImport.libraries.pythonMaxDepth |
3 |
How deep to recurse inside each Python package |
autoImport.libraries.pythonExtraPaths |
[] |
Additional site-packages directories to scan |
autoImport.python.respectAllDunder |
true |
Respect __all__ when determining exported names |
autoImport.typescript.preferTypeImports |
auto |
auto / always / never — when to emit import type |
autoImport.java.includeInnerClasses |
true |
Index inner public-static classes |
autoImport.cache.location |
workspace |
workspace (.vscode/.auto-import-cache) or global |
autoImport.cache.maxDiskMB |
20 |
Advisory upper bound on cache size |
autoImport.logLevel |
info |
info or debug (debug logs per-file and per-query) |
Commands
- Auto Import: Show Logs — opens the output channel
- Auto Import: Show Cache Stats — displays current file/symbol/name counts
- Auto Import: Rebuild Workspace Index — drops the in-memory state and rescans
- Auto Import: Restart Daemon — terminates the Rust daemon and respawns it (useful after updating the binary)
- Auto Import: Daemon Status — returns
{running, lastInit}(mainly for extension tests)
Architecture
┌──────────────────────────────────────────────┐ ┌──────────────────────────────────┐
│ VS Code Extension (thin client) │ │ Rust Daemon (autoimport- │
│ │ │ daemon native binary) │
│ ┌──────────────────────────────┐ │ │ │
│ │ DaemonCompletionProvider │─── query ──┼──────►│ SymbolIndex (StringTable + │
│ └──────────────────────────────┘ <─ items ─│ │ HotIndex + PrefixIndex) │
│ ┌──────────────────────────────┐ indexFile │ ─► │ tree-sitter (C FFI, native) │
│ │ DaemonClient (JSON-RPC) │ removeFile│ ─► │ Scanner (rayon parallel) │
│ │ spawn + stdin/stdout │ scan │ ─► │ Library scan (node_modules + │
│ └──────────────────────────────┘ │ │ site-packages) │
│ FileSystemWatcher + onDidChange ─ debounced │ ─► │ Persistence (bincode) │
└──────────────────────────────────────────────┘ └──────────────────────────────────┘
- IPC is newline-delimited JSON-RPC over stdio.
- The extension spawns one daemon per workspace. It dies when the extension host exits.
- The daemon uses native
tree-sitterbindings (no WASM), soAborted()/memory access out of boundscrashes from the WASM grammars are gone. - Incremental edits fire through
onDidChangeTextDocument→ debouncedindexFile(200 ms). External file changes are picked up viaFileSystemWatcher.
Performance
Measured on a 22k-file Python + TypeScript monorepo (MacBook Air M2):
| Phase | V1 (TS + web-tree-sitter) | V2 (Rust daemon) |
|---|---|---|
| Cold workspace scan | 18–25 s | 2–4 s |
| Library scan (10k+ files) | 8–18 s, ~5,700 parse crashes | 3–6 s, 0 crashes |
| Warm query (1–2 char prefix) | 1–3 ms | <1 ms |
| Repeat cold start (cache hit) | full rescan | <500 ms (mtime short-circuit) |
Distribution layout
A published .vsix contains:
extension/
├── package.json
├── README.md
├── CHANGELOG.md
├── LICENSE
├── resources/
│ └── icon.png
├── daemon/
│ ├── Cargo.toml
│ ├── Cargo.lock
│ └── src/
└── dist/
└── extension.js
No platform daemon binaries are shipped in the VSIX. On first activation the extension runs cargo build --release --locked from the bundled daemon/ source and copies the resulting binary to VS Code global storage, under a versioned bin/ directory. If no system Cargo is found, it downloads rustup-init, verifies its .sha256 file, and installs a minimal toolchain under the extension's own CARGO_HOME and RUSTUP_HOME.
Troubleshooting
- "native daemon build failed": run Auto Import: Show Logs to inspect the Cargo or rustup error. The extension builds the daemon on first activation.
- Corporate/offline machines: the first activation may need access to
static.rust-lang.orgfor Rust andcrates.iofor Cargo dependencies unless they are already cached locally. - Windows C compiler errors: rustup installs Rust/Cargo, but native C dependencies may still require Microsoft C++ Build Tools.
- Suggestions for a freshly installed
pippackage don't appear: run the command Auto Import: Rebuild Workspace Index, or just restart VS Code. - Cache seems stale: delete
.vscode/.auto-import-cache/and reopen the workspace. - "cache save failed: …": make sure the workspace directory is writable; alternatively set
autoImport.cache.locationtoglobal.
Contributing
The extension has 29 end-to-end tests covering all 4 languages, library scanning, re-export flattening, cache reload, and multi-line import merging.
npm run build # bundles the TS extension
npm run daemon:build # optional: prebuilds the Rust daemon for local dev/e2e
npm run test:e2e # runs the E2E suite via @vscode/test-electron
npm run icon # regenerates resources/icon.png
npm run package # TS + release layout check + vsce package -> .vsix
npm run publish # same, but uploads to the VS Code marketplace
Release checklist
- Bump
package.jsonversion+ add a CHANGELOG.md entry. - Run
npm run verify:releaseto ensure the VSIX includesdaemon/source and excludes prebuilt binaries. git tag v0.1.x && git push --tags— the release workflow uploads the.vsixas a GitHub release asset.
See PLAN.md for the full internal design document.
License
MIT — see LICENSE.