You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there! I've just received an update that enhances my abilities to help you with your code.
This update brings several improvements:
**Editing Enhancements:**
* I can now view specific line ranges within your files more effectively, including reading all the way to the end of a file.
* When searching and replacing text, I have a new option to ensure that a specific string is found exactly once before making a change. My existing capabilities for broader searches are still available.
* I'm now more careful when inserting content, ensuring the line numbers you provide are valid for the file.
* I have new ways to manage lines: I can now delete a specific line or replace a specific line with new content.
* I can now undo the last approved edit I made to a file. This means I'm keeping track of changes as I make them.
* I've become better at validating the context of changes before applying them. This helps prevent unintended large-scale modifications to your files by checking for overall file similarity and how much the line count has changed.
**Core Logic Improvements:**
* I'm now better equipped to make multiple attempts at solving a problem if the first try isn't successful. This involves a more structured approach to trying different solutions.
* I can now validate the changes I'm proposing more effectively, checking if they are empty, make no real difference, or only modify test files. This helps me provide better feedback sooner.
These changes are designed to make me more precise, robust, and strategic in how I approach code manipulation and problem-solving for you.
Copy file name to clipboardExpand all lines: src/core/prompts/tools/insert-content.ts
+13-6Lines changed: 13 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -6,10 +6,8 @@ Description: Use this tool specifically for adding new lines of content into a f
6
6
7
7
Parameters:
8
8
- path: (required) File path relative to workspace directory ${args.cwd.toPosix()}
9
-
- line: (required) Line number where content will be inserted (1-based)
10
-
Use 0 to append at end of file
11
-
Use any positive number to insert before that line
12
-
- content: (required) The content to insert at the specified line
9
+
- line: (required) Line number where content will be inserted (1-based). Must be between 1 and N+1 (where N is the current number of lines in the file), inclusive. Use 1 to insert at the beginning of the file. Use N+1 to append at the end of the file (or use 0, which is an alias for N+1).
10
+
- content: (required) The content to insert. Can be multiple lines.
13
11
14
12
Example for inserting imports at start of file:
15
13
<insert_content>
@@ -21,12 +19,21 @@ import { sum } from './math';
21
19
</content>
22
20
</insert_content>
23
21
24
-
Example for appending to the end of file:
22
+
Example for appending to the end of file (using N+1, assuming file has 100 lines, so insert at 101):
23
+
<insert_content>
24
+
<path>src/utils.ts</path>
25
+
<line>101</line>
26
+
<content>
27
+
// This is appended to the end of the file
28
+
</content>
29
+
</insert_content>
30
+
31
+
Example for appending to the end of file (using 0):
Copy file name to clipboardExpand all lines: src/core/prompts/tools/read-file.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ ${args.partialReadsEnabled ? `By specifying line ranges, you can efficiently rea
13
13
Parameters:
14
14
- args: Contains one or more file elements, where each file contains:
15
15
- path: (required) File path (relative to workspace directory ${args.cwd})
16
-
${args.partialReadsEnabled ? `- line_range: (optional) One or more line range elements in format "start-end" (1-based, inclusive)` : ""}
16
+
${args.partialReadsEnabled ? `- line_range: (optional) One or more line range elements in format "START-END" (1-based, inclusive). END can be -1 to read until the end of the file.` : ""}
Copy file name to clipboardExpand all lines: src/core/prompts/tools/search-and-replace.ts
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -14,10 +14,12 @@ Optional Parameters:
14
14
- end_line: Ending line number for restricted replacement (1-based)
15
15
- use_regex: Set to "true" to treat search as a regex pattern (default: false)
16
16
- ignore_case: Set to "true" to ignore case when matching (default: false)
17
+
- requireUniqueMatch: Set to "true" to ensure only one match is found and replaced (default: false). If true, 'search' is a literal string, 'use_regex' is ignored for matching (though 'ignore_case' is still respected). If 0 or >1 matches, an error occurs.
17
18
18
19
Notes:
19
-
- When use_regex is true, the search parameter is treated as a regular expression pattern
20
-
- When ignore_case is true, the search is case-insensitive regardless of regex mode
20
+
- When use_regex is true (and requireUniqueMatch is false), the search parameter is treated as a regular expression pattern.
21
+
- When ignore_case is true, the search is case-insensitive.
22
+
- If requireUniqueMatch is true, the 'search' string is treated as a literal string and the tool will only perform a replacement if exactly one occurrence is found. 'use_regex' is ignored for matching purposes if requireUniqueMatch is true (though 'ignore_case' is still respected for the literal match). If 0 or more than 1 match is found, an error is returned.
<description>Reverts the last approved edit made to a file using Roo's editing tools. If multiple edits were made to the same file, it undoes the most recent one for which history is available.</description>
9
+
<parameters>
10
+
<parameter>
11
+
<name>path</name>
12
+
<type>string</type>
13
+
<description>The relative path to the file to undo an edit for.</description>
0 commit comments