Go to Import
Navigate to files instantly by clicking on import paths!

Go to Import makes file paths in import statements clickable, allowing you to quickly navigate to referenced files with multiple convenient methods.
⚙️ Configuration
Customize your experience with the following configuration options:
✨ Features
- 🖱️ One-click navigation to imported files via
Cmd+Click
(configurable)
- ⌨️ Keyboard shortcuts for quick access (
Cmd+Shift+G
)
- 📱 Multiple access methods - context menu, status bar, command palette
- 🌍 Multi-language support for JavaScript, TypeScript, Python, CSS, and more
- 🧠 Smart path resolution for relative and absolute paths, path aliases (@, ~)
- 🔍 Automatic file extension detection
- 💡 Rich visual feedback with informative tooltips on hover
Visual Feedback
Hover over any import path to see instant feedback:
- ✅ File Found: Shows file name, relative path, and click instructions
- 📦 Library Import: Identifies NPM packages and library imports
- ❌ File Not Found: Shows attempted search paths to help debug missing files
- 🔍 Path Debugging: Displays which paths were searched and why resolution failed
- 🎯 Framework-friendly - works with React, Vue, Angular, and more
- 🔒 Security-first - comprehensive security measures built-in
🚀 Quick Start
Testing the Extension
Try the extension with the comprehensive examples in the example/
directory, which includes JavaScript, TypeScript, Python, and CSS files demonstrating various import patterns.
Method 1: Click to Navigate
- Open any file containing import statements
- Hold Cmd (Mac) or Ctrl (Windows/Linux) and hover over a file path
- Click the highlighted path to jump directly to that file
Method 2: Keyboard Shortcut
- Place cursor on or near an import path
- Press Cmd+Shift+G (Mac) or Ctrl+Shift+G (Windows/Linux)
- If multiple imports exist, select from the quick-pick menu
- Right-click on any import path
- Select "Jump to Import File" from the context menu
Method 4: Status Bar
- Look for the "🔗 Go to Import" button in the status bar (appears in supported files)
- Click to access jump functionality
Customizing Keybindings
You can customize the keyboard shortcut for jumping to imports:
{
"key": "cmd+alt+g",
"command": "go-to-import.jumpToImport",
"when": "editorTextFocus"
}
- Open Command Palette (Cmd+Shift+P / Ctrl+Shift+P)
- Search for "Preferences: Open Keyboard Shortcuts"
- Search for "Jump to Import File"
- Modify the keybinding to your preference
Default keybindings:
- macOS:
Cmd+Shift+G
- Windows/Linux:
Ctrl+Shift+G
Customizing Click Behavior
To change the Cmd+Click behavior system-wide:
Change Multi-Cursor Modifier (Recommended):
{
"editor.multiCursorModifier": "altKey"
}
This makes Alt+Click
create multiple cursors and frees up Cmd+Click
for links.
Custom Keybindings in keybindings.json:
[
{
"key": "cmd+alt+g",
"command": "go-to-import.jumpToImport",
"when": "editorTextFocus"
}
]
📁 Supported Path Types
The extension intelligently resolves:
- ✅ Relative paths (
./
, ../
)
- ✅ Absolute paths from workspace root
- ✅ Common file extensions automatically
- ✅ Index files in directories
- ✅ Files without extensions
🔧 Supported File Types
- JavaScript (
.js
, .jsx
)
- TypeScript (
.ts
, .tsx
)
- Python (
.py
)
- CSS/SCSS/LESS (
.css
, .scss
, .less
)
- JSON (
.json
)
- Vue (
.vue
)
- Svelte (
.svelte
)
📋 Supported Import Patterns
JavaScript/TypeScript
import React from 'react';
import { Component } from './component';
import utils from '../utils/helpers';
require('./module');
import('./dynamic-module');
Python
import os
from pathlib import Path
from .local import module
CSS/SCSS
@import './styles.css';
@import '../fonts/fonts.scss';
🔒 Security
This extension implements comprehensive security measures:
- Workspace Trust: Only operates in trusted workspaces
- Path Validation: Prevents path traversal and validates file access
- File Type Restrictions: Blocks access to executable and sensitive files
- Boundary Enforcement: Restricts access to workspace files only
For detailed security information, see SECURITY.md.
🎯 Requirements
- Visual Studio Code 1.74.0 or higher
- No additional dependencies required
📝 Release Notes
See CHANGELOG.md
🐛 Known Issues & Troubleshooting
Cmd-Click creates multiple cursors instead of jumping to file (macOS)
If the Cmd+Click
event is creating multiple cursors instead of
jumping to the file, this is due to VS Code's multi-cursor
modifier setting conflicting with the DocumentLinkProvider.
Solutions:
Change the multi-cursor modifier (Recommended):
- Open VS Code Settings (
Cmd+,
)
- Search for "multi cursor modifier"
- Change
editor.multiCursorModifier
from commandKey
to altKey
- Now use Alt+Click for multi-cursor and Cmd+Click for jumping to files
Use alternative methods:
- Keyboard: Press
Cmd+Shift+G
- Context menu: Right-click on an import path → "Jump to Import File"
- Status bar: Click the "🔗 Go to Import" button
- Command Palette:
Cmd+Shift+P
→ "Jump to Import File"
Use Ctrl+Click instead:
- Hold
Ctrl+Click
instead of Cmd+Click
to follow the link
Potential Issues
- Complex import patterns may not be detected
- Node modules imports are not resolved (by design for security)
- Very large files (>1MB) are skipped for performance
🤝 Contributing
We welcome contributions! Here's how you can help:
📄 License
This extension is licensed under the MIT License.
🙏 Acknowledgments
- Built with ❤️ using the VS Code Extension API
- Inspired by the need for faster navigation in modern development workflows
- Thanks to all contributors and users who provide feedback!
Enjoying Go to Import? Leave a review and help others discover it! ⭐