Skip to content

james-newell-forge/commentlinking

Β 
Β 

Repository files navigation

πŸ’¬ 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

  • Markdown Preview with anchors and links support:

    Markdown Preview Demo

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

  1. Open VS Code Output panel (View > Output)
  2. Select "Comment Linking" from the dropdown
  3. 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
  • πŸ“– Create Markdown preview with link and anchor support
  • 🧡 Support multiline comments (block and triple-quote styles)
  • 🌐 Add more languages (e.g., Go, Rust) and support .jsx/.tsx
  • πŸ“ Add support for using .gitignore file as default exclusion file

Made with 😑 by Viktor Kratiuk

About

πŸ”— VS Code extension for linking between comments in code. Create anchors and jump to them from anywhere

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 96.3%
  • JavaScript 3.7%