Skip to content

Commit 4819acd

Browse files
committed
Enhance documentation for Code Actions feature with detailed explanation of "Add to Context" functionality and usage examples
1 parent 99311a3 commit 4819acd

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

docs/features/code-actions.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,25 @@ Clicking the lightbulb, right-clicking and selecting "Roo Code", or using the ke
1616

1717
Roo Code provides the following Code Actions:
1818

19-
* **Explain Code:** Asks Roo Code to explain the selected code. This is useful for understanding unfamiliar code or for getting a high-level overview of a function or class.
20-
* **Fix Code:** Asks Roo Code to fix problems in the selected code. This action is available when there are diagnostics (errors or warnings) on the selected lines. Roo Code will analyze the diagnostics and propose a fix.
21-
* **Improve Code:** Asks Roo Code to suggest improvements to the selected code. This can include suggestions for better readability, performance, or adherence to best practices.
22-
* **Add to Context:** Adds the selected code to the current Roo Code conversation, allowing you to refer to it in subsequent messages.
19+
* **Add to Context:** Quickly adds the selected code to your chat with Roo, including line numbers so Roo knows exactly where the code is from. It's listed first in the menu for easy access. (More details below).
20+
* **Explain Code:** Asks Roo Code to explain the selected code.
21+
* **Fix Code:** Asks Roo Code to fix problems in the selected code (available when diagnostics are present).
22+
* **Improve Code:** Asks Roo Code to suggest improvements to the selected code.
23+
24+
### Add to Context Deep Dive
25+
26+
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.
27+
28+
This helps Roo understand the exact context of your code within the project, allowing it to provide more relevant and accurate assistance.
29+
30+
**Example Chat Input:**
31+
32+
```
33+
Can you explain this function?
34+
@myFile.js:15:25
35+
```
36+
37+
*(Where `@myFile.js:15:25` represents the code added via "Add to Context")*
2338

2439
Each of these actions can be performed "in a new task" or "in the current task."
2540

0 commit comments

Comments
 (0)