Open VSCode's built-in diff viewer directly from inline @DiffLink markers.
Add @DiffLink:path/to/file or @DiffLink:source, destination in a comment (or anywhere in a markdown / plain-text file), and a clickable CodeLens appears above the line plus a gutter icon — one click opens the diff.
DiffLink is designed for refactoring and migration workflows where you frequently compare old and new implementations.
Relative path (no leading /): resolved from the workspace root, e.g. src/main/file.ts.
Absolute path (leading / or drive letter): used directly as a filesystem path.
Git revision (git://HEAD~1): compares the current document with the same file at that git ref. The ref must exist in the current git repository, and the current file must exist at that ref.
Path traversal (.., ~) and external URLs (http://, file://) are rejected.
Highlights
One-click diff from a CodeLens above the marker line
Visual gutter icon (blue diff icon, or red error icon when the path can't be resolved)
Single-target and explicit two-file compare formats
Works across common text-based files (TypeScript, Java, Python, JavaScript, Markdown, XML, shell, config, ...)
Local-only behavior: no source upload, no remote diff processing
Settings
Setting
Default
Description
difflink.commentOnly
true
Only match markers on lines that look like comments. Markdown and plain-text files are always scanned everywhere.
Privacy
Local-only processing. DiffLink does not upload source code or diff content.