Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Command AutolinkNew to Visual Studio Code? Get it now.
Command Autolink

Command Autolink

ctf0

|
399 installs
| (1) | Free
Match links in document via regex and run a command on click
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Command Autolink

Match links in document via regex and run a command on click. Api Used

  • based on https://github.com/usernamehw/vscode-autolink

The Reason Behind This

is to use the alt/ctrl + click dynamically instead of creating numerous extensions with single usage or ask an extension author to add a link provider to something in specific.



Example :

"commandAutolink.queries": [
    {
        "linkFilePattern": "**/*{.yml,pecl}",                      // defaults to "**/*"
        "linkFileLanguage": ["php"],                               // similar to linkFilePattern but instead use language ids, defaults to []
        "linkPattern": "[\/]?((dev-ops|opt)[^\\s]+\\.[^\\s]{2,})", // any regex to match the text, required
        "linkCommand": "workbench.action.quickOpen",               // command id to execute when clicking the matched pattern link, required
        "linkText": "Go To File"                                   // command text to show in the hover popup
    },
],

Notes :

  • some commands doesn't require any arguments ex.Open File
  • and some other requires an argument to be passed to the command ex.workbench.action.quickOpen to work which in this case the first captured group in the linkPattern will be used.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft