mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-06 08:18:39 +00:00
Tweaks to support prompt line number format (#2121)
This commit is contained in:
parent
d3df954797
commit
60e122f2ca
2 changed files with 7 additions and 10 deletions
|
|
@ -10,8 +10,7 @@ describe("Code Action Prompts", () => {
|
|||
filePath: testFilePath,
|
||||
selectedText: testCode,
|
||||
})
|
||||
|
||||
expect(prompt).toContain(`@/${testFilePath}`)
|
||||
expect(prompt).toContain(testFilePath)
|
||||
expect(prompt).toContain(testCode)
|
||||
expect(prompt).toContain("purpose and functionality")
|
||||
expect(prompt).toContain("Key components")
|
||||
|
|
@ -25,8 +24,7 @@ describe("Code Action Prompts", () => {
|
|||
filePath: testFilePath,
|
||||
selectedText: testCode,
|
||||
})
|
||||
|
||||
expect(prompt).toContain(`@/${testFilePath}`)
|
||||
expect(prompt).toContain(testFilePath)
|
||||
expect(prompt).toContain(testCode)
|
||||
expect(prompt).toContain("Address all detected problems")
|
||||
expect(prompt).not.toContain("Current problems detected")
|
||||
|
|
@ -64,8 +62,7 @@ describe("Code Action Prompts", () => {
|
|||
filePath: testFilePath,
|
||||
selectedText: testCode,
|
||||
})
|
||||
|
||||
expect(prompt).toContain(`@/${testFilePath}`)
|
||||
expect(prompt).toContain(testFilePath)
|
||||
expect(prompt).toContain(testCode)
|
||||
expect(prompt).toContain("Code readability")
|
||||
expect(prompt).toContain("Performance optimization")
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ const supportPromptConfigs: Record<string, SupportPromptConfig> = {
|
|||
\${userInput}`,
|
||||
},
|
||||
EXPLAIN: {
|
||||
template: `Explain the following code from file path @/\${filePath} \${startLine}:\${endLine}
|
||||
template: `Explain the following code from file path \${filePath}:\${startLine}-\${endLine}
|
||||
\${userInput}
|
||||
|
||||
\`\`\`
|
||||
|
|
@ -48,7 +48,7 @@ Please provide a clear and concise explanation of what this code does, including
|
|||
3. Important patterns or techniques used`,
|
||||
},
|
||||
FIX: {
|
||||
template: `Fix any issues in the following code from file path @/\${filePath} \${startLine}:\${endLine}
|
||||
template: `Fix any issues in the following code from file path \${filePath}:\${startLine}-\${endLine}
|
||||
\${diagnosticText}
|
||||
\${userInput}
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ Please:
|
|||
4. Explain what was fixed and why`,
|
||||
},
|
||||
IMPROVE: {
|
||||
template: `Improve the following code from file path @/\${filePath} \${startLine}:\${endLine}
|
||||
template: `Improve the following code from file path \${filePath}:\${startLine}-\${endLine}
|
||||
\${userInput}
|
||||
|
||||
\`\`\`
|
||||
|
|
@ -79,7 +79,7 @@ Please suggest improvements for:
|
|||
Provide the improved code along with explanations for each enhancement.`,
|
||||
},
|
||||
ADD_TO_CONTEXT: {
|
||||
template: `\${filePath}:\${startLine}:\${endLine}
|
||||
template: `\${filePath}:\${startLine}-\${endLine}
|
||||
\`\`\`
|
||||
\${selectedText}
|
||||
\`\`\``,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue