Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Comment LinkingNew to Visual Studio Code? Get it now.
Comment Linking

Comment Linking

Viktor Kratiuk

|
1 install
| (0) | Free
🔗 Link between comments in code. Create anchors and jump to them from anywhere
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

💬 Comment Linking extension for VS Code

Logo

VS Marketplace VS Marketplace Downloads VS Marketplace Rating

Open VSX Registry Open VSX Downloads Open VSX Rating

License

🔗 Link between comments in code. Create anchors and jump to them from anywhere

🎬 Examples

  • Basic Link ↔ Anchor interaction:

    Link-Anchor Demo

  • Anchors view (tree of all anchors):

    Anchors View Demo

✅ Supported languages and file formats

  • JavaScript (.js)
  • TypeScript (.ts)
  • Python (.py)
  • JSON (.json)
  • JSON With Comments (.jsonc)
  • Markdown (.md) - full text support with special syntax

🧠 How it works

  • Add an anchor comment where you want to jump to: // [MyAnchor](#id)
  • Reference it elsewhere: // [Go to anchor](https://github.com/kratiuk/commentlinking/blob/HEAD/id)
  • Click the link to jump to the anchor. The Anchors view shows all anchors across your workspace.

📝 Syntax variations

In code comments (JS/TS/Python/JSON):

  • Create anchor: // [MyAnchor](#myId)
  • Link to anchor: // [Go to anchor](https://github.com/kratiuk/commentlinking/blob/HEAD/myId)

In Markdown files:

  • Create anchor: [MyAnchor](https://github.com/kratiuk/commentlinking/blob/HEAD/<>#myId)
  • Link to anchor: [Go to anchor](https://github.com/kratiuk/commentlinking/blob/HEAD/<>myId)
  • Cross-reference: Markdown can link to anchors in code comments and vice versa

⚙️ Custom File Types

You can extend support to any file type by configuring custom comment syntax in VS Code settings:

Open Settings → Search for commentLinking.customFileTypes OR directly edit your settings.json file

{
  "commentLinking.customFileTypes": {
    ".vue": "js",
    ".go": "js", 
    ".sh": "python",
    ... other extensions you want to add support for ...
  }
}

Configuration format:

  • Key (e.g. ".vue") - File extension to add support for
  • Value - Comment syntax type to use:
    • "js" - Uses // comments (like JavaScript/TypeScript)
    • "python" - Uses # comments (like Python/Shell)

Here's how it would work for .go files:

// [MyGoAnchor](#goExample) - This works in .go files
// [Link to anchor](https://github.com/kratiuk/commentlinking/blob/HEAD/goExample)

📂 Indexing scope & exclusions

  • Scans all workspace folders for supported file extensions
  • Excludes by default:
    • node_modules/
    • any dot-directories (names starting with a dot), e.g. .git/, .vscode/, .cache/

✨ Features

  • 🔍 Anchors tree view to browse anchors across files
  • 🎯 Inline links in comments that jump to anchors
  • 🖍️ Smart decorations to highlight only the preview text
  • 📋 Copy anchor ID from the Anchors view

📦 Installation

  1. Install the extension
  2. Reload VS Code window (you’ll be prompted on first install)

🧪 Development & Testing

To test changes during development:

  1. Press F5 to launch Extension Development Host
  2. Make changes to the code and save
  3. In the test window, run Developer: Reload Window to see updates

✅ Roadmap / To‑Do

  • [ ] 🧵 Support multiline comments (block and triple-quote styles)
  • [ ] 🌐 Add more languages (e.g., Go, Rust) and support .jsx/.tsx

Made with 😡 by Viktor Kratiuk

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