Skip to content

Commit d214ea6

Browse files
authored
prompts: use correct platform path in apply_patch example (#2712)
Closes microsoft/vscode#285997
1 parent cf6ea4d commit d214ea6

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/extension/prompts/node/agent/defaultAgentInstructions.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type { LanguageModelToolInformation } from 'vscode';
88
import { ConfigKey, IConfigurationService } from '../../../../platform/configuration/common/configurationService';
99
import { isGpt5PlusFamily } from '../../../../platform/endpoint/common/chatModelCapabilities';
1010
import { IChatEndpoint } from '../../../../platform/networking/common/networking';
11+
import { IPromptPathRepresentationService } from '../../../../platform/prompts/common/promptPathRepresentationService';
1112
import { IExperimentationService } from '../../../../platform/telemetry/common/nullExperimentationService';
1213
import { LanguageModelToolMCPSource } from '../../../../vscodeTypes';
1314
import { ToolName } from '../../../tools/common/toolNames';
@@ -417,6 +418,12 @@ export class CodesearchModeInstructions extends PromptElement<DefaultAgentPrompt
417418
}
418419

419420
export class ApplyPatchFormatInstructions extends PromptElement {
421+
constructor(
422+
props: BasePromptElementProps,
423+
@IPromptPathRepresentationService private readonly _promptPathRepresentationService: IPromptPathRepresentationService
424+
) {
425+
super(props);
426+
}
420427
render() {
421428
return <>
422429
*** Update File: [file_path]<br />
@@ -435,7 +442,7 @@ export class ApplyPatchFormatInstructions extends PromptElement {
435442
See below for an example of the patch format. If you propose changes to multiple regions in the same file, you should repeat the *** Update File header for each snippet of code to change:<br />
436443
<br />
437444
*** Begin Patch<br />
438-
*** Update File: /Users/someone/pygorithm/searching/binary_search.py<br />
445+
*** Update File: {this._promptPathRepresentationService.getExampleFilePath('/Users/someone/pygorithm/searching/binary_search.py')}<br />
439446
@@ class BaseClass<br />
440447
@@ def method():<br />
441448
[3 lines of pre-context]<br />

0 commit comments

Comments
 (0)