
path-lens
A fast, feature-rich Path IntelliSense extension for Visual Studio Code.
Usage
- Open any supported file.
- Type
./, ../, or a configured alias (e.g., @/) inside a string literal or import statement.
- Select your path from the completion list.
Extension Settings
This extension contributes the following settings:
| Setting |
Type |
Default |
Description |
pathLens.enable |
boolean |
true |
Enable or disable path completion globally. |
pathLens.alias |
object |
{ "@": "/src" } |
Map custom path aliases to target workspace directories. |
pathLens.excludePath |
array |
["**/node_modules/**", "**/out/**"] |
Glob patterns or directory paths to exclude from completions. |
pathLens.extensionGroup |
array |
[["ts", "tsx"], ["js", "jsx"],] |
Drops the file extension if both the active file and the target file belong to the same group. |
Requirements
No extra dependencies or external tools required! You can use this extension right out of the box.
Features
Path Intellisense provides path completion when a path alias is typed.
For example, if { "@": "/src" } is configured in settings.json, files inside /src will appear as completion suggestions when the user types @/.
Path Intellisense does not suggest files or directories that match the configured exclusion patterns.
For example, if node_modules is set as an excluded directory in settings.json, files and directories inside node_modules will not appear in path completion suggestions.
Path Intellisense displays a mini preview when an image file is selected from the path completion suggestions.

- Path Completion for Markdown
Path Intellisense provides path completion when a file path is typed in a Markdown file.
For example, when the user types ![image](https://github.com/tetsutohara/path-lens/raw/HEAD/images/, files inside ./images will appear as path completion suggestions.
- Existing Extension Replacement
Path Intellisense automatically replaces an existing file extension after the cursor when a path completion suggestion is selected, preventing duplicate file extensions.
For example, when the cursor is positioned at ./hoo|.tsx and hoo.tsx is selected, the completed path will be ./hoo.tsx instead of ./hoo.tsx.tsx.
Release Notes
See CHANGELOG.md for full version history and updates.
Contributing
Contributions are always welcome!
Please read CONTRIBUTING.md to get started with local development and submitting pull requests.
License
MIT License