Skip to content

Commit 795b2e2

Browse files
committed
feat: add Diagnostics Integration documentation and related features
1 parent 80ece27 commit 795b2e2

File tree

4 files changed

+169
-1
lines changed

4 files changed

+169
-1
lines changed

docs/basic-usage/context-mentions.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ Context mentions are a powerful way to provide Roo Code with specific informatio
6363
| **Groups** | Problems organized by file for better clarity |
6464
| **Best for** | Fixing errors without manual copying |
6565

66+
For comprehensive details on how Roo Code integrates with VSCode's diagnostics system, see [Diagnostics Integration](/features/diagnostics-integration).
67+
6668
### Terminal Mention
6769
<img src="/img/context-mentions/context-mentions-4.png" alt="Terminal mention example showing terminal output being included in Roo's context" width="600" />
6870

@@ -129,4 +131,11 @@ The dropdown automatically filters out common directories like `node_modules`, `
129131
| **`.gitignore` bypass** | Similarly, file and folder `@mentions` do not respect `.gitignore` rules when fetching content. |
130132
| **Git command respect** | Git-related mentions (`@git-changes`, `@commit-hash`) do respect `.gitignore` since they rely on Git commands. |
131133

134+
---
135+
136+
## Related Features
137+
138+
- [Diagnostics Integration](/features/diagnostics-integration) - Learn about automatic error detection and smart severity filtering
139+
- [Code Actions](/features/code-actions) - Discover quick fixes and AI assistance directly in your editor
140+
- [Shell Integration](/features/shell-integration) - Understand how terminal mentions work with shell integration
132141

docs/features/code-actions.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ The lightbulb menu intelligently shows different actions based on your code's cu
4141
- **Improve Code** - Receive optimization suggestions and best practices
4242
- **Add to Context** - Add the code to Roo's context for further work
4343

44+
For more details on how diagnostics are integrated with Code Actions, see [Diagnostics Integration](/features/diagnostics-integration).
45+
4446
### Add to Context Deep Dive
4547

4648
The **Add to Context** action is listed first in the Code Actions menu so you can quickly add code snippets to your conversation. When you use it, Roo Code includes the filename and line numbers along with the code.
@@ -124,7 +126,7 @@ You can customize the prompts used for each Code Action by modifying the "Suppor
124126
3. **Edit the Prompts:** Modify the text in the text area for the prompt you want to customize. The prompts use placeholders in the format `${placeholder}`:
125127
- `${filePath}` - The path of the current file
126128
- `${selectedText}` - The currently selected text
127-
- `${diagnostics}` - Any error or warning messages (for Fix Code)
129+
- `${diagnostics}` - Any error or warning messages (for Fix Code) - see [Diagnostics Integration](/features/diagnostics-integration) for details
128130
4. **Click "Done":** Save your changes.
129131

130132
### Example Prompt Template
@@ -135,3 +137,10 @@ ${selectedText}
135137
```
136138

137139
By using Roo Code's Code Actions, you can quickly get AI-powered assistance directly within your coding workflow. This can save you time and help you write better code.
140+
141+
---
142+
143+
## Related Features
144+
145+
- [Diagnostics Integration](/features/diagnostics-integration) - Learn how Roo Code integrates with VSCode's Problems panel
146+
- [Context Mentions](/basic-usage/context-mentions) - Discover other ways to provide context to Roo Code
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# Diagnostics Integration
2+
3+
Roo Code provides intelligent integration with VSCode's Problems panel, allowing the AI assistant to understand and help fix code errors, warnings, and other issues detected by language servers, linters, and other diagnostic providers.
4+
5+
---
6+
7+
## Overview
8+
9+
The diagnostics feature seamlessly integrates with VSCode's diagnostic system to provide context-aware assistance for code issues. When you make edits or encounter problems in your code, Roo Code can automatically detect and help resolve them.
10+
11+
### Key Capabilities
12+
- **Automatic Error Detection**: Captures new errors introduced during code edits
13+
- **Context-Aware Fixes**: Provides targeted fixes based on diagnostic information
14+
- **Workspace Problems Mention**: Access all workspace diagnostics through a simple mention
15+
- **Smart Filtering**: Uses predefined severity levels for different contexts
16+
17+
---
18+
19+
## Key Features
20+
21+
### 1. Automatic Error Detection
22+
When Roo Code makes edits to files, it automatically:
23+
- Captures diagnostics before editing
24+
- Waits for diagnostics to update after editing
25+
- Detects new problems introduced by the changes
26+
- Only reports new errors (not pre-existing ones)
27+
28+
This ensures you're immediately aware of any issues introduced by code changes, allowing for quick resolution.
29+
30+
### 2. Workspace Problems Mention
31+
Users can include `@problems` in their messages to:
32+
- Get a complete list of workspace errors and warnings
33+
- Provide context for debugging tasks
34+
- Request fixes for specific issues
35+
36+
Example usage:
37+
```
38+
@problems Fix all TypeScript errors in my project
39+
```
40+
41+
For more details on using `@problems`, see [Context Mentions](/basic-usage/context-mentions#problems-mention).
42+
43+
### 3. Code Actions Integration
44+
When diagnostics exist at a cursor position:
45+
- "Fix with Roo Code" action appears in quick fix menu
46+
- Includes diagnostic details in the fix request
47+
- Provides targeted solutions based on error context
48+
49+
Learn more about this integration in [Code Actions](/features/code-actions#context-aware-actions).
50+
51+
### 4. Smart Severity Filtering
52+
Different features use different severity filters to provide the most relevant information:
53+
- **Workspace Problems mention**: Shows errors and warnings
54+
- **Automatic detection**: Shows only errors (to avoid distraction)
55+
- **Context-Aware**: Different features use different hardcoded severity filters
56+
57+
---
58+
59+
## Severity Levels
60+
61+
The diagnostics system recognizes four severity levels from VSCode:
62+
63+
| Level | Value | Description | Workspace Problems | Auto-detection |
64+
|-------|-------|-------------|-------------------|----------------|
65+
| Error | 0 | Syntax errors, type errors, breaking issues | ✅ Included | ✅ Included |
66+
| Warning | 1 | Code quality issues, deprecations, style violations | ✅ Included | ❌ Not included |
67+
| Information | 2 | Suggestions, hints, informational messages | ❌ Not included | ❌ Not included |
68+
| Hint | 3 | Minor suggestions, refactoring opportunities | ❌ Not included | ❌ Not included |
69+
70+
### Why Different Filters?
71+
72+
- **Workspace Problems (`@problems`)**: Includes both errors and warnings to give you a complete picture of code health when explicitly requested
73+
- **Automatic Detection**: Only includes errors to avoid interrupting your workflow with non-critical issues
74+
75+
---
76+
77+
## Using Diagnostics Effectively
78+
79+
### For Debugging Sessions
80+
When starting a debugging session, include `@problems` to give Roo Code full context:
81+
```
82+
@problems Help me debug why my application is crashing
83+
```
84+
85+
### For Code Reviews
86+
Use diagnostics to ensure code quality:
87+
```
88+
@problems Review my code and fix any linting issues
89+
```
90+
91+
### For Refactoring
92+
Let diagnostics guide safe refactoring:
93+
```
94+
I want to refactor this function. @problems shows current issues to address.
95+
```
96+
97+
---
98+
99+
## Integration with Other Features
100+
101+
### Code Actions
102+
Diagnostics power the context-aware [Code Actions](/features/code-actions) that appear in VSCode's lightbulb menu. When errors are present, you'll see "Fix Code" options that include the specific diagnostic information.
103+
104+
### Context Mentions
105+
The [`@problems` mention](/basic-usage/context-mentions#problems-mention) provides a convenient way to include all workspace diagnostics in your conversation without manually copying error messages.
106+
107+
### Automatic Error Reporting
108+
When Roo Code edits files, any new errors introduced are automatically reported in the response, helping maintain code quality throughout the editing process.
109+
110+
---
111+
112+
## Best Practices
113+
114+
1. **Use `@problems` for Context**: When debugging, always include `@problems` to give Roo Code full visibility into current issues
115+
116+
2. **Address Errors First**: Focus on fixing errors before warnings, as errors typically prevent code from running
117+
118+
3. **Leverage Code Actions**: Use the quick fix menu for targeted fixes to specific diagnostics
119+
120+
4. **Monitor Auto-Detection**: Pay attention to new errors reported after edits to catch issues early
121+
122+
5. **Combine with Other Tools**: Use diagnostics alongside other Roo Code features like codebase search and file mentions for comprehensive problem-solving
123+
124+
---
125+
126+
## Troubleshooting
127+
128+
### Diagnostics Not Appearing
129+
- Ensure your language server or linter is properly configured and running
130+
- Check that the file type is supported by your diagnostic providers
131+
- Verify that VSCode's Problems panel shows the issues
132+
133+
### `@problems` Shows Nothing
134+
- Confirm there are actually problems in the Problems panel
135+
- Check that you're in the correct workspace
136+
- Some diagnostic providers may take time to initialize
137+
138+
### Auto-Detection Missing Errors
139+
- Only new errors (introduced by edits) are reported
140+
- Pre-existing errors won't be shown in auto-detection
141+
- Use `@problems` to see all current issues
142+
143+
---
144+
145+
## Related Features
146+
147+
- [Context Mentions](/basic-usage/context-mentions) - Learn about all mention types including `@problems`
148+
- [Code Actions](/features/code-actions) - Discover how diagnostics integrate with quick fixes
149+
- [Codebase Search](/features/codebase-indexing) - Find code related to specific errors

sidebars.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const sidebars: SidebarsConfig = {
4242
'features/code-actions',
4343
'features/codebase-indexing',
4444
'features/custom-instructions',
45+
'features/diagnostics-integration',
4546
'features/custom-modes',
4647
'features/fast-edits',
4748
'features/enhance-prompt',

0 commit comments

Comments
 (0)