Skip to content

Commit e043c00

Browse files
committed
docs: enhance context mentions documentation with detailed examples and images
1 parent a7ca080 commit e043c00

File tree

8 files changed

+114
-60
lines changed

8 files changed

+114
-60
lines changed
Lines changed: 114 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,122 @@
11
# Context Mentions
22

3-
Context mentions are a powerful way to provide Roo Code with specific information about your project, allowing it to perform tasks more accurately and efficiently. You can use mentions to refer to files, folders, problems, and Git commits. Context mentions start with the `@` symbol.
3+
Context mentions are a powerful way to provide Roo Code with specific information about your project, allowing it to perform tasks more accurately and efficiently. You can use mentions to refer to files, folders, problems, and Git commits. Context mentions start with the `@` symbol.
44

5-
## Types of Mentions
6-
7-
### File Mentions (`@/path/to/file.ts`)
8-
9-
Use file mentions to include the contents of a specific file in your request.
10-
11-
* **Example:** "Explain the function `calculateTotal` in the file @/src/utils.ts."
12-
* **How it works:** Roo Code will read the contents of the specified file and include it in the context sent to the AI model.
13-
* **Best Practices**: Always include the `/` to tell Roo you're specifying a file path.
14-
* **Note:** You can use the `@` character in any chat field, so you may use it while also providing feedback.
15-
16-
### Folder Mentions (`@/path/to/folder/`)
17-
18-
Use folder mentions to refer to a directory. Roo Code will be able to use the *names* of the files and subdirectories within that folder.
19-
20-
* **Example:** "What files are in the @/src/components/ folder?"
21-
* **Note**: To find files inside of that folder, you will need to ask Roo to use one of its tools, `list files`.
22-
23-
### Problems Mention (`@problems`)
24-
25-
Use the `@problems` mention to include a list of all current errors and warnings from the VS Code Problems panel in your request.
26-
27-
* **Example:** "@problems Fix all errors in the current file."
28-
* **Note:** This is especially useful when you see errors in the Problems panel and want Roo Code to address them.
29-
30-
### Terminal Mention (`@terminal`)
5+
<img src="/img/context-mentions/context-mentions.png" alt="Context Mentions Overview - showing the @ symbol dropdown menu in the chat interface" width="600" />
316

32-
Use the `@terminal` mention to include the last command run in the terminal along with its output.
7+
*Context mentions overview showing the @ symbol dropdown menu in the chat interface.*
338

34-
* **Example:** "Fix the warnings in the @terminal."
35-
36-
### Git Commit Mentions (`@a1b2c3d`)
37-
38-
Use a Git commit hash (short or long) to include information about a specific commit.
39-
40-
* **Example:** "What changes were made in commit @a1b2c3d?"
41-
* **Note:** Roo Code will include the commit message, author, date, and a diff of the changes.
42-
43-
If you want to refer to the working changes in the git repository, you can use the `@git-changes` mention.
44-
45-
* **Example:** "Can you propose a commit message for @git-changes?"
46-
47-
### URL Mentions (`@https://example.com`)
48-
49-
Use a URL to have Roo Code fetch and include the content of a website.
50-
51-
* **Example:** "Summarize the content of @https://docusaurus.io/."
52-
* **Note:** Roo Code will convert the website content to Markdown.
53-
54-
## Using Mentions
55-
56-
* **Type `@`:** Start typing `@` in the chat input field. A dropdown menu will appear with suggestions.
57-
* **Select a Mention:** Use the arrow keys or your mouse to select the desired mention from the dropdown, and press Enter or click to insert it.
58-
* **Type to Search:** As you type after the `@` symbol, the suggestions will be filtered.
59-
* **Multiple Mentions:** You can include multiple mentions in a single message.
60-
* **Combine with Text:** You can combine mentions with regular text to create your request. For example: "Check the function in @/src/utils.ts and fix any @problems".
9+
## Types of Mentions
6110

62-
## Tips
11+
<img src="/img/context-mentions/context-mentions-1.png" alt="File mention example showing a file being referenced with @ and its contents appearing in the conversation" width="600" />
6312

64-
* **Be Specific:** The more specific your mentions are, the better Roo Code will understand your request.
65-
* **Use Relative Paths:** When referring to files within your workspace, use paths relative to the workspace root.
66-
* **Check for Typos:** Make sure the file paths and commit hashes are correct.
13+
*File mentions add actual code content into the conversation for direct reference and analysis.*
6714

68-
Context mentions are a powerful tool for providing Roo Code with the information it needs to complete your tasks effectively. Experiment with different types of mentions to see how they can improve your workflow.
15+
| Mention Type | Format | Description | Example Usage |
16+
|--------------|--------|-------------|--------------|
17+
| **File** | `@/path/to/file.ts` | Includes file contents in request context | "Explain the function in @/src/utils.ts" |
18+
| **Folder** | `@/path/to/folder/` | Provides directory structure in tree format | "What files are in @/src/components/?" |
19+
| **Problems** | `@problems` | Includes VS Code Problems panel diagnostics | "@problems Fix all errors in my code" |
20+
| **Terminal** | `@terminal` | Includes recent terminal command and output | "Fix the errors shown in @terminal" |
21+
| **Git Commit** | `@a1b2c3d` | References specific commit by hash | "What changed in commit @a1b2c3d?" |
22+
| **Git Changes** | `@git-changes` | Shows uncommitted changes | "Suggest a message for @git-changes" |
23+
| **URL** | `@https://example.com` | Imports website content | "Summarize @https://docusaurus.io/" |
24+
25+
### File Mentions
26+
27+
<img src="/img/context-mentions/context-mentions-1.png" alt="File mention example showing a file being referenced with @ and its contents appearing in the conversation" width="600" />
28+
29+
*File mentions incorporate source code with line numbers for precise references.*
30+
| Capability | Details |
31+
|------------|---------|
32+
| **Format** | `@/path/to/file.ts` (always start with `/` from workspace root) |
33+
| **Provides** | Complete file contents with line numbers |
34+
| **Supports** | Text files, PDFs, and DOCX files (with text extraction) |
35+
| **Works in** | Initial requests, feedback responses, and follow-up messages |
36+
| **Limitations** | Very large files may be truncated; binary files not supported |
37+
38+
### Folder Mentions
39+
40+
<img src="/img/context-mentions/context-mentions-2.png" alt="Folder mention example showing directory contents being referenced in the chat" width="600" />
41+
42+
*Folder mentions display directory structure in a readable tree format.*
43+
| Capability | Details |
44+
|------------|---------|
45+
| **Format** | `@/path/to/folder/` (note trailing slash) |
46+
| **Provides** | Hierarchical tree display with ├── and └── prefixes |
47+
| **Includes** | Immediate child files and directories (not recursive) |
48+
| **Best for** | Understanding project structure |
49+
| **Tip** | Use with file mentions to check specific file contents |
50+
51+
### Problems Mention
52+
53+
<img src="/img/context-mentions/context-mentions-3.png" alt="Problems mention example showing VS Code problems panel being referenced with @problems" width="600" />
54+
55+
*Problems mentions import diagnostics directly from VS Code's problems panel.*
56+
| Capability | Details |
57+
|------------|---------|
58+
| **Format** | `@problems` |
59+
| **Provides** | All errors and warnings from VS Code's problems panel |
60+
| **Includes** | File paths, line numbers, and diagnostic messages |
61+
| **Groups** | Problems organized by file for better clarity |
62+
| **Best for** | Fixing errors without manual copying |
63+
64+
### Terminal Mention
65+
<img src="/img/context-mentions/context-mentions-4.png" alt="Terminal mention example showing terminal output being included in Roo's context" width="600" />
66+
67+
*Terminal mentions capture recent command output for debugging and analysis.*
68+
69+
| Capability | Details |
70+
|------------|---------|
71+
| **Format** | `@terminal` |
72+
| **Captures** | Last command and its complete output |
73+
| **Preserves** | Terminal state (doesn't clear the terminal) |
74+
| **Limitation** | Limited to visible terminal buffer content |
75+
| **Best for** | Debugging build errors or analyzing command output |
76+
77+
### Git Mentions
78+
79+
<img src="/img/context-mentions/context-mentions-5.png" alt="Git commit mention example showing commit details being analyzed by Roo" width="600" />
80+
81+
*Git mentions provide commit details and diffs for context-aware version analysis.*
82+
| Type | Format | Provides | Limitations |
83+
|------|--------|----------|------------|
84+
| **Commit** | `@a1b2c3d` | Commit message, author, date, and complete diff | Only works in Git repositories |
85+
| **Working Changes** | `@git-changes` | `git status` output and diff of uncommitted changes | Only works in Git repositories |
86+
87+
### URL Mentions
88+
<img src="/img/context-mentions/context-mentions-6.png" alt="URL mention example showing website content being converted to Markdown in the chat" width="600" />
89+
90+
*URL mentions import external web content and convert it to readable Markdown format.*
91+
92+
| Capability | Details |
93+
|------------|---------|
94+
| **Format** | `@https://example.com` |
95+
| **Processing** | Uses headless browser to fetch content |
96+
| **Cleaning** | Removes scripts, styles, and navigation elements |
97+
| **Output** | Converts content to Markdown for readability |
98+
| **Limitation** | Complex pages may not convert perfectly |
99+
100+
## How to Use Mentions
101+
102+
1. Type `@` in the chat input to trigger the suggestions dropdown
103+
2. Continue typing to filter suggestions or use arrow keys to navigate
104+
3. Select with Enter key or mouse click
105+
4. Combine multiple mentions in a request: "Fix @problems in @/src/component.ts"
106+
107+
The dropdown automatically suggests:
108+
- Recently opened files
109+
- Visible folders
110+
- Recent git commits
111+
- Special keywords (`problems`, `terminal`, `git-changes`)
112+
113+
## Best Practices
114+
115+
| Practice | Description |
116+
|----------|-------------|
117+
| **Use specific paths** | Reference exact files rather than describing them |
118+
| **Use relative paths** | Always start from workspace root: `@/src/file.ts` not `@C:/Projects/src/file.ts` |
119+
| **Verify references** | Ensure paths and commit hashes are correct |
120+
| **Click mentions** | Click mentions in chat history to open files or view content |
121+
| **Eliminate copy-pasting** | Use mentions instead of manually copying code or errors |
122+
| **Combine mentions** | "Fix @problems in @/src/component.ts using the pattern from commit @a1b2c3d" |
16.8 KB
Loading
6.5 KB
Loading
16.6 KB
Loading
16.2 KB
Loading
9 KB
Loading
18.4 KB
Loading
33.1 KB
Loading

0 commit comments

Comments
 (0)