README.md

November 4, 2025 ยท View on GitHub

vscode-alias-jump

๐Ÿš€ Smart Path Alias Navigation for VS Code

Version Downloads Rating License

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

  1. Open VS Code
  2. Press Ctrl+P / Cmd+P
  3. Type ext install simonhe.vscode-alias-jump
  4. Press Enter

Or search for "vscode-alias-jump" in the Extensions view.

๐Ÿš€ Quick Start

1. Configure Your Project

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

LanguageExtensionSupport
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

  1. Discovery - Finds the nearest tsconfig.json / jsconfig.json for each file
  2. Parsing - Extracts compilerOptions.paths and merges from references
  3. Resolution - Resolves aliases with support for multiple candidates
  4. Navigation - Provides Cmd+Click links and F12 "Go to Definition"
  5. Caching - Intelligently caches results with document-level granularity

๐Ÿ› Troubleshooting

Aliases not working?

  1. โœ… Check that you have a tsconfig.json or jsconfig.json in your workspace
  2. โœ… Verify the paths configuration is correct
  3. โœ… Make sure the target files exist
  4. โœ… Try reloading VS Code window (Cmd+R / Ctrl+R)
  • 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!

  1. Fork the repository
  2. Create your feature branch (git checkout -b feat/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feat/amazing-feature)
  5. 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