Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Path ConverterNew to Visual Studio Code? Get it now.
Path Converter

Path Converter

homelesstoseek

| (0) | Free
Convert relative paths to absolute paths using Path Intellisense mappings
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Path Converter VSCode Extension

A VSCode extension that converts relative paths to absolute paths using Path Intellisense mappings.

Features

  • Convert relative paths (e.g., ~/foo/bar.js) to absolute paths (e.g., /share/org/YZWL/yzwl_wenhao/foo/bar.js)
  • Uses path-intellisense.mappings configuration from VSCode settings
  • Keyboard shortcut: Ctrl+Shift+Alt+P (Windows/Linux) or Cmd+Shift+Alt+P (Mac)
  • Supports multiple path prefixes defined in the mappings
  • Automatically detects the path at cursor position

Installation

  1. Clone this repository
  2. Run npm install to install dependencies
  3. Run npm run compile to build the extension
  4. Press F5 in VSCode to open a new Extension Development Host window
  5. Test the extension in the new window

Configuration

Add path mappings to your VSCode settings (.vscode/settings.json or user settings):

{
  "path-intellisense.mappings": {
    "~": "/share/org/YZWL/yzwl_wenhao",
    "@": "/project/src",
    "$lib": "/usr/local/lib"
  }
}

Usage

  1. Place your cursor on a relative path (e.g., ~/foo/bar.js)
  2. Press Ctrl+Shift+Alt+P (or Cmd+Shift+Alt+P on Mac)
  3. The path will be converted to its absolute form based on your mappings

Example

Before:

import { foo } from '~/utils/helper.js';

After (with mapping "~": "/share/org/YZWL/yzwl_wenhao"):

import { foo } from '/share/org/YZWL/yzwl_wenhao/utils/helper.js';

Commands

  • Convert Relative Path to Absolute: Convert the path at cursor position to absolute path

Development

Building

npm install
npm run compile

Watching for Changes

npm run watch

Linting

npm run lint

Requirements

  • VSCode 1.75.0 or higher
  • Node.js and npm

Known Issues

None at this time.

Publishing

To publish this extension to the VSCode Marketplace:

Prerequisites

  1. Create a publisher account at Visual Studio Marketplace
  2. Install vsce (Visual Studio Code Extensions):
    npm install -g @vscode/vsce
    
  3. Get a Personal Access Token (PAT) from Azure DevOps

Steps to Publish

  1. Update the publisher name in package.json:

    "publisher": "your-publisher-name"
    
  2. Package the extension:

    vsce package
    

    This creates a .vsix file.

  3. Test the package locally:

    • In VSCode, go to Extensions view
    • Click "..." menu → "Install from VSIX..."
    • Select the .vsix file
  4. Publish to marketplace:

    vsce publish
    

    Or manually upload the .vsix file to the marketplace.

Pre-publish Checklist

  • [x] All tests pass (npm test)
  • [x] Code compiles without errors (npm run compile)
  • [x] Extension tested in development mode (F5)
  • [x] README.md is complete and accurate
  • [x] LICENSE file exists
  • [x] CHANGELOG.md is up to date
  • [x] package.json has all required fields (publisher, repository, etc.)
  • [ ] Publisher name is set to your actual publisher ID
  • [ ] Version number is appropriate

Release Notes

See CHANGELOG.md for detailed release notes.

0.0.1

Initial release:

  • Basic path conversion functionality
  • Support for multiple path prefixes
  • Keyboard shortcut support
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft