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

|
20 installs
| (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

🧠 How it works

  • Add an anchor comment where you want to jump to: [[AnchorID|Some anchor]]

  • Reference it elsewhere: [[#AnchorID|Go to anchor]]

  • Click the link while holding Ctrl (Cmd on macOS) to jump to the anchor. The Anchors view shows all anchors across your workspace

  • Basic Link ↔ Anchor interaction:

    Link-Anchor Demo

  • Anchors view (tree of all anchors):

    Note: This demo shows the legacy anchor syntax Anchors View Demo

    Click to see legacy syntax demo
    (enable commentLinking.enableLegacySyntax in settings)

    Legacy Syntax Demo

    Legacy Syntax

βœ… Supported languages and file formats

  • JavaScript (.js)
  • TypeScript (.ts)
  • TypeScript React (.tsx)
  • JavaScript React (.jsx)
  • Python (.py)
  • Rust (.rs)
  • Go (.go)
  • C (.c)
  • C++ (.cpp, .cxx, .cc, .hpp, .h)
  • C# (.cs)
  • JSON (.json)
  • JSON With Comments (.jsonc)
  • Markdown (.md) - full text support with special syntax

βš™οΈ 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",
    ".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)

📂 Indexing scope & exclusions

  • Scans all workspace folders for supported file extensions
  • Gitignore support: Uses .gitignore patterns by default (disable via commentLinking.useGitignore setting)
  • Custom exclusions: Create .commentlinkingignore file in project root to exclude additional files/directories
  • Priority: .commentlinkingignore takes precedence over .gitignore patterns

✨ 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)

📊 Debugging & Logging

To view detailed indexing logs and performance information:

  1. Open VS Code Output panel (View > Output)
  2. Select "Comment Linking" from the dropdown
  3. Watch real-time indexing progress and timing information

🧪 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

To build and install the extension manually:

  1. Install all dependencies: pnpm install
  2. Build the extension package: pnpm package
  3. Install the generated .vsix file in VS Code: Extensions > Install from VSIX...

βœ… Roadmap / To‑Do

  • [ ] 📖 Create Markdown preview with link and anchor support
  • [ ] 🔗 Add support for creating anchors and links without preview text in backlinks
  • [ ] 🔀 Add sorting by line numbers in anchor tree view
  • [ ] βš™οΈ Add support for custom comment types for specific files
  • [ ] 🎨 Add functionality to configure anchor and link styles
  • [ ] 🔄 Add functionality to disable new syntax if users want to use only legacy syntax
  • [ ] 🏷️ Add button in anchor tree to toggle between displaying anchor IDs and preview text
  • [ ] 🔍 Add support for displaying all links to a specific anchor in the editor
  • [ ] 📚 Add and host comprehensive documentation
  • [x] 🧵 Support multiline comments (block and triple-quote styles)
  • [x] 🌐 Add more languages (e.g., Go, Rust) and support .jsx/.tsx
  • [x] 📁 Add support for using .gitignore file as default exclusion file

Made with 😡 by Viktor Kratiuk

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