Skip to content

Commit 60e122f

Browse files
authored
Tweaks to support prompt line number format (#2121)
1 parent d3df954 commit 60e122f

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

src/shared/__tests__/support-prompts.test.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ describe("Code Action Prompts", () => {
1010
filePath: testFilePath,
1111
selectedText: testCode,
1212
})
13-
14-
expect(prompt).toContain(`@/${testFilePath}`)
13+
expect(prompt).toContain(testFilePath)
1514
expect(prompt).toContain(testCode)
1615
expect(prompt).toContain("purpose and functionality")
1716
expect(prompt).toContain("Key components")
@@ -25,8 +24,7 @@ describe("Code Action Prompts", () => {
2524
filePath: testFilePath,
2625
selectedText: testCode,
2726
})
28-
29-
expect(prompt).toContain(`@/${testFilePath}`)
27+
expect(prompt).toContain(testFilePath)
3028
expect(prompt).toContain(testCode)
3129
expect(prompt).toContain("Address all detected problems")
3230
expect(prompt).not.toContain("Current problems detected")
@@ -64,8 +62,7 @@ describe("Code Action Prompts", () => {
6462
filePath: testFilePath,
6563
selectedText: testCode,
6664
})
67-
68-
expect(prompt).toContain(`@/${testFilePath}`)
65+
expect(prompt).toContain(testFilePath)
6966
expect(prompt).toContain(testCode)
7067
expect(prompt).toContain("Code readability")
7168
expect(prompt).toContain("Performance optimization")

src/shared/support-prompt.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const supportPromptConfigs: Record<string, SupportPromptConfig> = {
3535
\${userInput}`,
3636
},
3737
EXPLAIN: {
38-
template: `Explain the following code from file path @/\${filePath} \${startLine}:\${endLine}
38+
template: `Explain the following code from file path \${filePath}:\${startLine}-\${endLine}
3939
\${userInput}
4040
4141
\`\`\`
@@ -48,7 +48,7 @@ Please provide a clear and concise explanation of what this code does, including
4848
3. Important patterns or techniques used`,
4949
},
5050
FIX: {
51-
template: `Fix any issues in the following code from file path @/\${filePath} \${startLine}:\${endLine}
51+
template: `Fix any issues in the following code from file path \${filePath}:\${startLine}-\${endLine}
5252
\${diagnosticText}
5353
\${userInput}
5454
@@ -63,7 +63,7 @@ Please:
6363
4. Explain what was fixed and why`,
6464
},
6565
IMPROVE: {
66-
template: `Improve the following code from file path @/\${filePath} \${startLine}:\${endLine}
66+
template: `Improve the following code from file path \${filePath}:\${startLine}-\${endLine}
6767
\${userInput}
6868
6969
\`\`\`
@@ -79,7 +79,7 @@ Please suggest improvements for:
7979
Provide the improved code along with explanations for each enhancement.`,
8080
},
8181
ADD_TO_CONTEXT: {
82-
template: `\${filePath}:\${startLine}:\${endLine}
82+
template: `\${filePath}:\${startLine}-\${endLine}
8383
\`\`\`
8484
\${selectedText}
8585
\`\`\``,

0 commit comments

Comments
 (0)