Skip to content

Add git-ai blame visualization to JetBrains plugin#741

Open
Krishnachaitanyakc wants to merge 4 commits intogit-ai-project:mainfrom
Krishnachaitanyakc:feat/jetbrains-blame-660
Open

Add git-ai blame visualization to JetBrains plugin#741
Krishnachaitanyakc wants to merge 4 commits intogit-ai-project:mainfrom
Krishnachaitanyakc:feat/jetbrains-blame-660

Conversation

@Krishnachaitanyakc
Copy link
Copy Markdown
Contributor

@Krishnachaitanyakc Krishnachaitanyakc commented Mar 17, 2026

Summary

Implements AI blame annotations in the JetBrains IntelliJ plugin, matching the VS Code extension's functionality. Resolves #660.

  • Calls git-ai blame --json --contents - CLI to get per-line AI authorship data
  • Gutter color stripes: 4px colored icons in the gutter for AI-authored lines (40-color palette, same as VS Code)
  • Inline after-text inlays: Shows model name after the line end (e.g. Sonnet 3.5 via Cursor)
  • Status bar widget: Shows AI model or human indicator for the current cursor line; click to toggle mode
  • Toggle action: Cmd+Shift+G / Ctrl+Shift+G cycles through Off → Line → All modes
  • ModelNameParser: Ported from VS Code extension — formats raw model strings into display names
  • 300ms debounced refresh on document edits, LRU cache (20 entries), dirty-file support via stdin piping

Open with Devin

@Krishnachaitanyakc Krishnachaitanyakc marked this pull request as draft March 17, 2026 15:52
devin-ai-integration[bot]

This comment was marked as resolved.

@Krishnachaitanyakc Krishnachaitanyakc force-pushed the feat/jetbrains-blame-660 branch 5 times, most recently from b503fd1 to e11fc9a Compare March 18, 2026 02:14
Implements AI blame annotations in the IntelliJ plugin, matching the
VS Code extension's functionality. Calls `git-ai blame --json --contents -`
to get per-line AI authorship data and renders it via:

- Gutter color stripes (4px colored icons per AI-authored line)
- Inline after-text inlays showing model name (e.g. "Sonnet 3.5 via Cursor")
- Status bar widget showing AI/human indicator for current line
- Toggle action (Cmd+Shift+G) cycling Off/Line/All modes

New files: BlameModels, BlameService, BlameEditorManager,
BlameStatusBarWidgetFactory, BlameToggleAction, BlameStartupActivity,
ModelNameParser (ported from VS Code extension).
@Krishnachaitanyakc Krishnachaitanyakc force-pushed the feat/jetbrains-blame-660 branch from e11fc9a to f9ea024 Compare March 18, 2026 18:36
@Krishnachaitanyakc Krishnachaitanyakc marked this pull request as ready for review March 18, 2026 21:01
devin-ai-integration[bot]

This comment was marked as resolved.

- BlameService: start stdout/stderr readers before stdin write and make
  stdin write async to prevent pipe buffer deadlock on files >64KB
- BlameEditorManager: use getEditors(file) instead of selectedTextEditor
  in fileOpened callback to resolve correct editor in split-editor scenarios
- Add consolidated pre-commit checks section to CLAUDE.md covering
  process I/O patterns, IntelliJ API misuses, Rust formatting, and lint
@Krishnachaitanyakc Krishnachaitanyakc marked this pull request as draft March 19, 2026 16:00
devin-ai-integration[bot]

This comment was marked as resolved.

BlameEditorManager.dispose() was calling Disposer.dispose(state) and
clearDecorations() directly without invokeLater, causing EDT threading
violations when the service is disposed from a background thread during
project closing. Now matches the pattern already used in detachFromEditor().
@Krishnachaitanyakc Krishnachaitanyakc marked this pull request as ready for review March 22, 2026 19:14
devin-ai-integration[bot]

This comment was marked as resolved.

@svarlamov
Copy link
Copy Markdown
Member

@Krishnachaitanyakc Do you have a moment to review the Devin feedback above? Also, we recently had an issue with the VS Code extension's blame where the git-ai blame calls weren't being throttled, so it was calling blame on every keystroke which is extremely CPU-intensive. Can you take pass to just verify this impl isn't impacted by this bug and that if the user disables the blame feature, it actually stops making git blame calls as well (not just stop showing in the UI)> Thanks!

- Replace containsKey()+put() with atomic putIfAbsent() to prevent
  concurrent threads from creating duplicate EditorBlameState with
  orphaned listeners and decorations.
- Add early-exit in scheduleBlameRefresh() when blameMode is OFF so
  no scheduler tasks or git-ai CLI calls are made while disabled.
- Cancel pending refreshes and clear decorations in toggleBlameMode()
  when switching to OFF.
@Krishnachaitanyakc
Copy link
Copy Markdown
Contributor Author

@svarlamov addressed both

@Krishnachaitanyakc
Copy link
Copy Markdown
Contributor Author

@svarlamov can you review this? This is not dependent on #798

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show git-ai blame (similar to VS Code extension) in Jetbrains

2 participants