Skip to content

Commit ea2bfe3

Browse files
committed
allow to edit untitled files
1 parent beb71c1 commit ea2bfe3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/vs/workbench/contrib/chat/common/tools/editFileTool.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const EditToolData: IToolData = {
5555
},
5656
filePath: {
5757
type: 'string',
58-
description: 'An absolute path to the file to edit',
58+
description: 'An absolute path to the file to edit, or the URI of a untitled, not yet named, file, such as `untitled:Untitled-1.',
5959
},
6060
code: {
6161
type: 'string',
@@ -180,10 +180,10 @@ export class EditToolInputProcessor implements IToolInputProcessor {
180180
// Tool name collision, or input wasn't properly validated upstream
181181
return input as any;
182182
}
183-
183+
const filePath = input.filePath;
184184
// Runs in EH, will be mapped
185185
return {
186-
file: URI.file(input.filePath),
186+
file: filePath.startsWith('untitled:') ? URI.parse(filePath) : URI.file(filePath),
187187
explanation: input.explanation,
188188
code: input.code,
189189
};

0 commit comments

Comments
 (0)