💬 Comment Linking extension for VS Code
🔗 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:

Anchors view (tree of all anchors):
Note: This demo shows the legacy anchor syntax

Markdown Preview with anchors and links support:

β¨ Supports back/forward navigation, live reload on file changes, and opens linked Markdown files within the same preview
β¨ 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
- 📖 Markdown Preview with anchors and links support
- 🙈 Ignore files on all levels (
.gitignore, .commentlinkingignore, .git/.commentlinkingignore)
β
Supported languages and file formats
C (.c)
C# (.cs)
C++ (.cpp, .cxx, .cc, .hpp, .h)
Clojure (.clj, .cljs, .cljc)
CSS (.css, .scss, .sass, .less)
Dart (.dart)
Dockerfile (Dockerfile, dockerfile, Dockerfile.*)
Go (.go)
HTML (.html, .htm) - supports HTML, JavaScript, and CSS comments
Java (.java)
JavaScript (.js)
JavaScript React (.jsx)
JSON (.json)
JSON With Comments (.jsonc)
Kotlin (.kt, .kts)
Makefile (Makefile, makefile, .mk)
Markdown (.md) - full text support
PHP (.php)
PowerShell (.ps1, .psm1, .psd1)
Python (.py)
Ruby (.rb)
Rust (.rs)
Shell (.sh, .bash, .zsh)
Svelte (.svelte)
Swift (.swift)
TOML (.toml)
TypeScript (.ts)
TypeScript React (.tsx)
Vue (.vue)
XML (.xml)
YAML (.yaml, .yml)
📂 Indexing scope & exclusions
- Scans all workspace folders for supported file extensions
🙈 Supported ignore files
| File |
Works |
Priority |
Note |
.gitignore |
by default |
lowest |
Disable via commentLinking.useGitignore setting |
.commentlinkingignore |
always |
medium |
Project-level exclusions |
.git/.commentlinkingignore |
always |
highest |
Local exclusions, not tracked by git |
📦 Installation
- Search for
Comment Linking in VS Code Marketplace and install
- Reload
VS Code window (you'll be prompted on first install)
To install a manually built version (Snapshot Build):
β οΈ This requires Node.js and pnpm installed on your machine
git clone https://github.com/kratiuk/commentlinking.git
cd commentlinking
pnpm install
pnpm package # This will generate a .vsix file
Then in VS Code: Extensions β ... β Install from VSIX... and select the generated file
📊 Debugging & Logging
To view detailed indexing logs and performance information:
- Open VS Code Output panel (
View > Output)
- Select "Comment Linking" from the dropdown
- Watch real-time indexing progress and timing information
β
Roadmap / ToβDo
- [ ] 🔗 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 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] 📖 Create Markdown preview with link and anchor support
- [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
| |