DEV Community

Cover image for I Built a VS Code Extension "Show History for Selection"
No Name
No Name

Posted on

I Built a VS Code Extension "Show History for Selection"

I Built a VS Code Extension to Bring IntelliJ’s “Show History for Selection” Experience

If you come from IntelliJ, you probably miss one super useful feature in VS Code:

Show history for selected lines.

I built a new extension to solve exactly that.

Meet: Show History for Selected Code

This extension helps you inspect Git history for a specific code selection, not just the whole file.

What it does

  • Shows commit history for the lines you selected
  • Opens a side-by-side diff:
    • Parent (previous revision)
    • Revision (selected commit)
  • Syncs scrolling between both sides for easier comparison
  • Lets you resize the commits section
  • Click a commit message to open full details in a modal

Why I built it

In day-to-day debugging and code review, I often ask:

  • “Who changed this exact block?”
  • “What did this snippet look like before?”
  • “Why was this line introduced?”

git blame is useful, but it’s not enough when you want a clean visual timeline + commit-level diff focused on your selection.

So I built this extension to make that workflow fast and visual.

How to use

  1. Open any Git-tracked file in VS Code
  2. Select one or more lines
  3. Run command: Show History for Selection
  4. Pick a commit from the list
  5. Compare Parent vs Revision instantly

Technical notes

  • Built as a VS Code extension (TypeScript)
  • Uses Git line-history queries and range fallback
  • Optimized UI for quick investigation workflow
  • Marketplace-ready packaging and branding

Who is this for?

  • Developers debugging regressions
  • Reviewers investigating code changes
  • Teams migrating from IntelliJ to VS Code/Cursor
  • Anyone who wants better Git line-level visibility

Try it

If this sounds useful, give it a try and share feedback.

I’d love to hear:

  • What workflows you use it for
  • Features you want next (filters, inline blame, keyboard shortcuts, etc.)
  • Any edge cases in large repos

What I’m planning next

  • Better commit filtering/search
  • Richer diff context options
  • UX polish for huge files and long histories
  • What workflows you use it for
  • Features you want next (filters, inline blame, keyboard shortcuts, etc.)
  • Any edge cases in large repos

What I’m planning next

  • Better commit filtering/search
  • Richer diff context options
  • UX polish for huge files and long histories

Top comments (0)