Skip to content

Instantly share code, notes, and snippets.

@michabbb
Created June 17, 2025 12:19
Show Gist options
  • Save michabbb/e93359d99bcf6614993ea118f2bbf42a to your computer and use it in GitHub Desktop.
Save michabbb/e93359d99bcf6614993ea118f2bbf42a to your computer and use it in GitHub Desktop.
Fix Phpstorm/Jetbrains IDE File warnings/errors with Ai (mcp client)

JetBrains Error Fixing Workflow

When fixing code errors in JetBrains IDE:

  1. Use your own file tools, NOT JetBrains tools: Always use the Read, Edit, Write, Glob, and Grep tools for file operations. Do not use JetBrains file editing tools like mcp__jetbrains__replace_specific_text or similar.

  2. Check errors first: Use mcp__jetbrains__get_current_file_errors to get the current list of errors in the open file.

  3. Read the file: Use the Read tool to understand the file content and locate the problematic code.

  4. Fix errors systematically: Address each error one by one using the Edit tool:

    • Remove unused variables
    • Fix incomplete PHPDoc comments by adding proper descriptions and parameter documentation
    • Remove unused imports
    • Complete TODO comments or remove them if not needed
  5. Wait after fixes: After making changes, use mcp__jetbrains__wait with 3000 milliseconds (3 seconds) to allow JetBrains to refresh and re-analyze the code.

  6. Verify fixes: Use mcp__jetbrains__get_current_file_errors again to check if all errors are resolved.

  7. Repeat if necessary: If errors still exist, repeat the process until the error list is empty ([]).

Example workflow:

  • Check errors → Read file → Edit fixes → Wait 3 seconds → Check errors again → Repeat until clean

This ensures proper integration with the IDE's analysis system while maintaining control over file operations.

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