Overview
The Diagnostics tool retrieves code diagnostics (errors, warnings, and hints) from active Language Server Protocol (LSP) clients. This provides semantic code analysis that goes beyond simple syntax checking.The path to the file to get diagnostics for. Leave empty to get diagnostics for the entire project.
Features
- Multi-severity reporting - Displays errors, warnings, and hints
- Grouped by severity - Results organized by diagnostic severity level
- Detailed information - Provides line numbers, columns, and diagnostic messages
- LSP-powered - Leverages configured LSP servers for accurate analysis
Usage
Get Diagnostics for a Specific File
Get Project-Wide Diagnostics
Output Format
Diagnostics are displayed in a structured format:When to Use
Use the Diagnostics tool when you need to:- Check for compilation or type errors before running code
- Get a comprehensive list of issues in a file or project
- Understand LSP-reported problems
- Validate code changes before committing
Limitations
- Depends on configured and running LSP servers
- May not cover all possible code issues
- Does not provide automatic fixes (use the Edit tool to apply fixes)
Tips
- Use with the References tool for comprehensive code analysis
- Run after making significant code changes
- Check project-wide diagnostics before commits
- Use file-specific diagnostics for targeted debugging
See Also
- LSP Configuration - Configure LSP servers
- References Tool - Find symbol references
- Edit Tool - Fix identified issues