🚀 Smart Path Alias Navigation for VS Code
English | įŽäŊ䏿
⨠Features
vscode-alias-jump is a powerful VS Code extension that provides intelligent path alias resolution and navigation. Say goodbye to broken Cmd+Click navigation when using path aliases like @/components/Button!
🎯 Core Capabilities
- 🔍 Smart Alias Resolution - Automatically resolves path aliases from
tsconfig.json / jsconfig.json
- âĄī¸ Multi-Format Support - Works with
import, require(), import(), HTML src, and CSS url()
- 🔄 Hot Reload - Auto-refreshes when config files change (no restart needed!)
- 📦 Monorepo Ready - Per-document alias resolution for complex workspace structures
- 🎨 Multi-Language - Supports Vue, React, TypeScript, JavaScript, CSS, SCSS, Less
- 💾 Smart Caching - Intelligent cache invalidation for optimal performance
- 🔗 Multiple Paths - Detects and resolves multiple import paths in a single line
- 🎯 Precise Navigation - Click exactly on the path you want to navigate to
- âĄī¸ Async I/O - Non-blocking file resolution for smooth editing experience
🆚 Why Choose This Over Others?
Unlike other alias extensions that only work at the root level, vscode-alias-jump:
- â
Resolves aliases per-document (perfect for monorepos)
- â
Supports
tsconfig references and project references
- â
Handles multiple alias candidates with priority order
- â
Auto-detects and strips query strings (
?raw) and hash fragments
- â
Uses async I/O to avoid blocking the editor
- â
Provides retry mechanism for reliability
📦 Installation
- Open VS Code
- Press
Ctrl+P / Cmd+P
- Type
ext install simonhe.vscode-alias-jump
- Press Enter
Or search for "vscode-alias-jump" in the Extensions view.
🚀 Quick Start
Add path aliases to your tsconfig.json or jsconfig.json:
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"],
"~/*": ["src/*"],
"#components/*": ["src/components/*"],
"#utils/*": ["src/utils/*"]
}
}
}
2. Start Using!
The extension works automatically once activated. Just Cmd+Click (macOS) or Ctrl+Click (Windows/Linux) on any aliased import:
// â
All of these work!
import Button from '@/components/Button'
import { helper } from '~/utils/helper'
const Icon = () => import('#components/Icon')
require('@/config/constants')
// â
CSS/SCSS too!
@import '@/styles/variables.scss';
background: url('~/assets/logo.png');
// â
HTML/Vue templates
<img src="@/assets/image.png" />
īŋŊ Supported File Types
| Language |
Extension |
Support |
| Vue |
.vue |
â
|
| TypeScript |
.ts |
â
|
| JavaScript |
.js |
â
|
| React (JSX) |
.jsx |
â
|
| React (TSX) |
.tsx |
â
|
| CSS |
.css |
â
|
| SCSS |
.scss |
â
|
| Less |
.less |
â
|
🔥 Advanced Features
Multiple Alias Candidates
If your paths config has multiple candidates, the extension will try them in order:
{
"compilerOptions": {
"paths": {
"@/*": ["src/*", "lib/*", "packages/*/src/*"]
}
}
}
TypeScript Project References
The extension automatically follows tsconfig references:
{
"references": [
{ "path": "./packages/core" },
{ "path": "./packages/utils" }
]
}
Monorepo Support
Each file uses its nearest tsconfig.json / jsconfig.json, making it perfect for monorepos with multiple packages!
Auto-Reload on Config Changes
When you update tsconfig.json or jsconfig.json, the extension automatically:
- 🔄 Invalidates cached aliases
- 📝 Reloads the configuration
- 🧹 Clears outdated navigation cache
No manual restart required!
âī¸ How It Works
- Discovery - Finds the nearest
tsconfig.json / jsconfig.json for each file
- Parsing - Extracts
compilerOptions.paths and merges from references
- Resolution - Resolves aliases with support for multiple candidates
- Navigation - Provides
Cmd+Click links and F12 "Go to Definition"
- Caching - Intelligently caches results with document-level granularity
🐛 Troubleshooting
Aliases not working?
- â
Check that you have a
tsconfig.json or jsconfig.json in your workspace
- â
Verify the
paths configuration is correct
- â
Make sure the target files exist
- â
Try reloading VS Code window (
Cmd+R / Ctrl+R)
Navigation goes to wrong file?
- Check if you have multiple alias candidates - the first match wins
- Verify your
baseUrl is set correctly in the config
🤝 Contributing
Issues and pull requests are welcome!
- Fork the repository
- Create your feature branch (
git checkout -b feat/amazing-feature)
- Commit your changes (
git commit -m 'feat: add amazing feature')
- Push to the branch (
git push origin feat/amazing-feature)
- Open a Pull Request
🌱 Inspiration
This project is inspired by alias-skip and enhanced with many powerful features for modern development workflows.
If this extension helps you, consider buying me a coffee! â
â¤ī¸ Sponsor on GitHub
📄 License
MIT Š 2024 Simon He
Made with â¤ī¸ by Simon He