When fixing code errors in JetBrains IDE:
-
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. -
Check errors first: Use
mcp__jetbrains__get_current_file_errors
to get the current list of errors in the open file. -
Read the file: Use the Read tool to understand the file content and locate the problematic code.
-
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
-
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. -
Verify fixes: Use
mcp__jetbrains__get_current_file_errors
again to check if all errors are resolved. -
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.