Skip to content

Commit 93f43be

Browse files
committed
More renaming
1 parent 15c2b49 commit 93f43be

File tree

4 files changed

+40
-40
lines changed

4 files changed

+40
-40
lines changed

src/core/Cline.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1601,7 +1601,7 @@ export class Cline {
16011601

16021602
if (!userEdits) {
16031603
pushToolResult(
1604-
`The code block was successfully inserted in ${relPath.toPosix()}.${newProblemsMessage}`,
1604+
`The content was successfully inserted in ${relPath.toPosix()}.${newProblemsMessage}`,
16051605
)
16061606
await this.diffViewProvider.reset()
16071607
break

src/core/prompts/tools/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { getReadFileDescription } from "./read-file"
33
import { getWriteToFileDescription } from "./write-to-file"
44
import { getSearchFilesDescription } from "./search-files"
55
import { getListFilesDescription } from "./list-files"
6-
import { getInsertCodeBlockDescription } from "./insert-code-block"
6+
import { getInsertContentDescription } from "./insert-content"
77
import { getSearchAndReplaceDescription } from "./search-and-replace"
88
import { getListCodeDefinitionNamesDescription } from "./list-code-definition-names"
99
import { getBrowserActionDescription } from "./browser-action"
@@ -15,7 +15,7 @@ import { getSwitchModeDescription } from "./switch-mode"
1515
import { DiffStrategy } from "../../diff/DiffStrategy"
1616
import { McpHub } from "../../../services/mcp/McpHub"
1717
import { Mode, ModeConfig, getModeConfig, isToolAllowedForMode, getGroupName } from "../../../shared/modes"
18-
import { ToolName, getToolName, getToolOptions, TOOL_GROUPS, ALWAYS_AVAILABLE_TOOLS } from "../../../shared/tool-groups"
18+
import { ToolName, TOOL_GROUPS, ALWAYS_AVAILABLE_TOOLS } from "../../../shared/tool-groups"
1919
import { ToolArgs } from "./types"
2020

2121
// Map of tool names to their description functions
@@ -32,7 +32,7 @@ const toolDescriptionMap: Record<string, (args: ToolArgs) => string | undefined>
3232
use_mcp_tool: (args) => getUseMcpToolDescription(args),
3333
access_mcp_resource: (args) => getAccessMcpResourceDescription(args),
3434
switch_mode: () => getSwitchModeDescription(),
35-
insert_content: (args) => getInsertCodeBlockDescription(args),
35+
insert_content: (args) => getInsertContentDescription(args),
3636
search_and_replace: (args) => getSearchAndReplaceDescription(args),
3737
apply_diff: (args) =>
3838
args.diffStrategy ? args.diffStrategy.getToolDescription({ cwd: args.cwd, toolOptions: args.toolOptions }) : "",
@@ -105,6 +105,6 @@ export {
105105
getUseMcpToolDescription,
106106
getAccessMcpResourceDescription,
107107
getSwitchModeDescription,
108-
getInsertCodeBlockDescription,
108+
getInsertContentDescription,
109109
getSearchAndReplaceDescription,
110110
}

src/core/prompts/tools/insert-code-block.ts

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { ToolArgs } from "./types"
2+
3+
export function getInsertContentDescription(args: ToolArgs): string {
4+
return `## insert_content
5+
Description: Inserts content at specific line positions in a file. This is the primary tool for adding new content and code (functions/methods/classes, imports, attributes etc.) as it allows for precise insertions without overwriting existing content. The tool uses an efficient line-based insertion system that maintains file integrity and proper ordering of multiple insertions. Beware to use the proper indentation. This tool is the preferred way to add new content and code to files.
6+
Parameters:
7+
- path: (required) The path of the file to insert content into (relative to the current working directory ${args.cwd.toPosix()})
8+
- operations: (required) A JSON array of insertion operations. Each operation is an object with:
9+
* start_line: (required) The line number where the content should be inserted. The content currently at that line will end up below the inserted content.
10+
* content: (required) The content to insert at the specified position. IMPORTANT NOTE: If the content is a single line, it can be a string. If it's a multi-line content, it should be a string with newline characters (\n) for line breaks. Make sure to include the correct indentation for the content.
11+
Usage:
12+
<insert_content>
13+
<path>File path here</path>
14+
<operations>[
15+
{
16+
"start_line": 10,
17+
"content": "Your content here"
18+
}
19+
]</operations>
20+
</insert_content>
21+
Example: Insert a new function and its import statement
22+
<insert_content>
23+
<path>File path here</path>
24+
<operations>[
25+
{
26+
"start_line": 1,
27+
"content": "import { sum } from './utils';"
28+
},
29+
{
30+
"start_line": 10,
31+
"content": "function calculateTotal(items: number[]): number {\n return items.reduce((sum, item) => sum + item, 0);\n}"
32+
}
33+
]</operations>
34+
</insert_content>`
35+
}

0 commit comments

Comments
 (0)