Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>path-definition-providerNew to Visual Studio Code? Get it now.
path-definition-provider

path-definition-provider

Creeperasha

|
2 installs
| (0) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Path Upward Definition Provider

VS Code extension that enables Go to Definition (F12 / Ctrl+Click) for file paths embedded in plain text.

The extension resolves relative paths by traversing parent directories upward until it finds a matching root folder name.

Features

  • Supports Go to Definition on file paths inside text

  • Works even when files are located outside the current workspace

  • Supports:

    • relative paths
    • absolute paths
    • quoted paths
  • Integrates with:

    • F12
    • Ctrl+Click
    • context menu → Go to Definition

Resolution Algorithm

For relative paths:

  1. Take the first directory name from the path

  2. Start from the current file directory

  3. Traverse upward through parent directories

  4. When a directory name matches the first path segment:

    • attempt to resolve the remaining relative path
  5. If the file does not exist:

    • continue traversing upward
  6. Stop on the first successful match

Example

Current file:

/test/test1/test2/test3/test.txt

Referenced path:

test1/file.txt

Resolved target:

/test/test1/file.txt

Absolute Paths

Absolute paths are opened directly if the target file exists.

Example:

/home/user/project/file.txt

or

C:\Projects\app\file.txt

Supported Path Formats

test1/file.txt
"test1/file.txt"
'test1/file.txt'

Installation

From VSIX

code --install-extension path-upward-definition-provider.vsix

Development

Install dependencies:

npm install

Compile:

npm run compile

Run extension host:

  • Press F5
  • or use Run Extension from the Debug panel

Usage

  1. Open any .proto file
  2. Place cursor on a path
  3. Press:
    • F12
    • or Ctrl+Click

The extension will attempt to resolve and open the referenced file.

Limitations

  • Currently opens only existing files
  • Does not resolve glob patterns
  • Does not support archive/virtual filesystems
  • First successful match wins

Possible Future Improvements

  • Line/column support (file.txt:42)
  • Directory navigation
  • Fuzzy path matching
  • Extension fallback resolution
  • Path resolution cache
  • Configurable search roots
  • Multi-target selection UI

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft