Intelligent IntelliJ IDEA plugin that helps developers resolve GitHub PR review comments using AI assistance. Fetch comments from GitHub, view them with full context, and get AI-powered suggestions for fixes.
- Fetch PR Comments - Pull all inline review comments and discussion comments from any GitHub PR
- Code Context - Automatically fetches code snippets with surrounding lines for context
- Review Status - Shows overall review status (Approved, Changes Requested, Commented)
- Smart Grouping - Groups related comments by file and code snippet
- Visual Indicators - Indented display for grouped comments
- OpenAI Integration - Uses GPT-4o to analyze comments and suggest fixes
- Full File Context - Reads the entire file locally for better AI understanding
- Focused Solutions - AI only modifies the specific lines mentioned in comments
- Token Optimization - Only uses local files (no GitHub fetching) to save API costs
- Split View - Comments list on the left, details on the right
- Expandable Sections - Comment, code context, AI analysis, and proposed code
- Syntax Highlighting - Code displayed with proper language highlighting
- Filter Options - View all comments, only inline, or only discussion comments
- Copy to Clipboard - Easy copying of code snippets with line numbers stripped
- Edit Comments - Modify comment text before sending to AI
- Left Panel: Filterable list of PR comments (grouped by code snippet)
- Right Panel: Comment details, code context, AI analysis, and proposed changes
Comments about the same code snippet appear together with visual indentation:
#123 β’ alice β’ App.kt:45 β’ open
β³ bob β’ App.kt:47 β’ open
β³ charlie β’ App.kt:50 β’ open
- IntelliJ IDEA (2023.1 or later)
- GitHub Personal Access Token (optional for public repos, required for private)
- OpenAI API Key
- Clone this repository
- Open in IntelliJ IDEA
- Build the plugin:
./gradlew buildPlugin - Install from disk:
Settings β Plugins β βοΈ β Install Plugin from Disk
Via Settings UI (Recommended):
- Go to
Settings β Tools β LLM Settings - Enter your OpenAI API Key
- Enter your GitHub Token (optional)
Via Environment Variables (Fallback):
export OPENAI_API_KEY="sk-proj-..."
export GITHUB_TOKEN="ghp_..."- Go to https://github.com/settings/tokens
- Click "Generate new token (classic)"
- Select scopes:
public_repo(for public repositories)repo(for private repositories)
- Copy the token and paste in plugin settings
-
Open the Tool Window
View β Tool Windows β PR Comment Resolver
-
Fetch PR Comments
- Enter repository:
owner/repo(e.g.,facebook/react) - Enter PR number:
123 - Click "Fetch Comments"
- Enter repository:
-
Filter Comments (Optional)
- Use dropdown to show: All / Inline / Discussion comments
-
Select a Comment
- Click on any comment in the list
- View comment details and code context on the right
-
Get AI Analysis
- Click "Resolve with AI"
- Wait for AI to analyze and propose a fix
- Review the suggested changes
-
Copy Proposed Code
- Click "Copy" button under the AI proposed code
- Paste into your editor
- Select a comment
- Click "Edit" button
- Modify the comment text
- Click "Resolve with AI" (automatically saves)
- Click the expand icon (β) on any section to view full-screen
- Click again to collapse
- Inline comments automatically show code snippets
- Lines are numbered for easy reference
- Target lines marked with
>>prefix
GitHubService.fetchPrSnapshot(owner, repo, prNumber)The plugin:
- Calls GitHub API to get PR details
- Fetches all review comments (inline + discussion)
- Downloads code snippets at specific commits
- Computes overall review status
- Groups comments by file and code snippet
When you click "Resolve with AI", the plugin:
- Tries to find the file locally in your IntelliJ project
- Reads the entire file (if found)
- Sends full file to AI for better context
- Falls back to snippet-only if file not found (saves tokens)
The AI receives:
- Full file content (for imports, class structure, dependencies)
- Target lines to focus on
- Comment text explaining what needs to change
- PR context (review status, other comments)
The AI returns:
- Brief explanation of the change
- OLD CODE (before)
- NEW CODE (after) - only the modified lines
- β Local files only - No GitHub fetching for token savings
- β Smart filtering - Only sends full file if found locally
- β Focused prompts - Instructs AI to modify specific lines only
| Scenario | Input Tokens | Cost per Request |
|---|---|---|
| Small file (100 lines) | ~400 | ~$0.001 |
| Medium file (500 lines) | ~2,000 | ~$0.005 |
| Large file (2000 lines) | ~8,000 | ~$0.020 |
| Snippet only (no file) | ~200 | ~$0.0005 |
Tip: The plugin logs token estimates in the console for each request.
When full file context is used:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
FULL FILE CONTEXT ADDED TO AI PROMPT
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π File: src/main/java/Example.java
π File size: 3456 characters (120 lines)
π― Target lines to modify: 45-52
π° Estimated tokens: ~864
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
When file not found locally:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β οΈ FILE NOT FOUND LOCALLY - SNIPPET-ONLY MODE
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π File: src/main/java/Example.java
π Snippet size: 245 characters
π° Saving tokens by not fetching from GitHub
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Icons indicate comment type (inline vs discussion)
- Visual grouping with indentation for related comments
- Status badges (open, resolved, outdated)
- Location info (file:line)
-
Comment Section
- Author and timestamp
- Comment body (editable)
- Edit/Save/Cancel buttons
-
Code Context Section (Inline comments only)
- Syntax-highlighted code
- Line numbers with target lines marked
- Copy button
-
AI Analysis Section (After resolving)
- Explanation of changes
- Old code vs new code
- Expand for full view
-
AI Proposed Code Section
- Ready-to-use code fix
- Copy button for easy pasting
Comments are grouped when they:
- Are in the same file (
filePathmatches) - Have the same code snippet (normalized for whitespace)
- Are consecutive in the sorted list
- File path (alphabetically)
- Code snippet (normalized)
- Line number (ascending)
App.kt:10 // First comment in group
β³ App.kt:12 // Grouped (same file + same snippet)
β³ App.kt:15 // Grouped (same file + same snippet)
App.kt:50 // Different snippet, not grouped
Utils.kt:20 // Different file, not grouped
src/main/kotlin/com/intellij/ml/llm/template/
βββ ui/
β βββ PrResolverPanel.kt # Main UI panel
β βββ components/ # Reusable UI components
β βββ layout/ # Custom layouts
βββ services/
β βββ GitHubService.kt # GitHub API integration
β βββ OpenAiService.kt # OpenAI API integration
βββ models/
β βββ PrComment.kt # Data models
βββ settings/
βββ LLMSettingsManager.kt # Settings management
βββ LLMConfigurable.kt # Settings UI
PrResolverPanel - Main UI component with:
- Comment list with filtering
- Details panel with sections
- Button actions (Fetch, Resolve, Copy)
- Comment grouping logic
GitHubService - GitHub API wrapper:
fetchPrSnapshot()- Main entry pointfetchFileAtCommit()- Get file at specific commitcomputeReviewSummary()- Calculate overall status
OpenAiService - OpenAI integration:
analyzePrSnapshot()- Send PR data to AI- Uses Chat Completions API (gpt-4o)
# Build plugin
./gradlew buildPlugin
# Run in sandbox IDE
./gradlew runIde
# Run tests
./gradlew test- JVM 17+
- IntelliJ IDEA 2023.1+
- Gson (JSON parsing)
- IntelliJ Platform SDK
- Java HTTP Client (for API calls)
- Check your GitHub token is valid
- Ensure token has correct scopes (
repoorpublic_repo) - Try regenerating the token
- Verify OpenAI API key is correct
- Check you have credits in your OpenAI account
- Make sure the project corresponding to the PR is open in IntelliJ
- Check the file paths match between GitHub and your local project
- The plugin will still work with snippet-only context
- This happens for discussion comments (expected)
- Discussion comments don't have associated code
- Only inline review comments show code context
- Stored securely in IntelliJ's PasswordSafe
- macOS: Keychain
- Windows: Windows Credential Store
- Linux: KWallet/Secret Service
- Never committed to Git
- Not stored in plain text
- PR data fetched via HTTPS
- No data stored permanently
- OpenAI requests sent over HTTPS
- Code snippets only sent when you click "Resolve"
- Only supports GitHub (no GitLab/Bitbucket yet)
- Requires local file for full context (falls back to snippet-only)
- AI can only modify specific line ranges (by design)
- No automatic code application (manual copy-paste required)
- Auto-apply AI suggestions to code
- Support for GitLab and Bitbucket
- Multiple AI provider support (Claude, Gemini)
- Comment resolution workflow (mark as resolved)
- Diff view for proposed changes
- Batch processing of multiple comments
- Custom AI prompts/templates
- Comment reply directly from plugin
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with IntelliJ Platform SDK
- Uses OpenAI GPT-4o for AI analysis
- Integrates with GitHub API
For issues, questions, or contributions:
- Open an issue on GitHub
- Check existing issues for solutions
- Contribute via pull requests
- Lines of Code: ~1000
- Main UI Class:
PrResolverPanel.kt(980 lines) - Services: GitHub + OpenAI integration
- Supported Languages: Any language supported by GitHub
Made with β€οΈ for developers who want to resolve PR comments faster!