From 9b9093e4c966e647d3b1c98cd1e197987a48669c Mon Sep 17 00:00:00 2001 From: Oleg Solomko Date: Wed, 29 Jan 2025 12:50:52 -0800 Subject: [PATCH] make non-prompt file references non-readonly by default (#239138) [prompts]: make non-prompt file references non-readonly by default --- .../chatAttachmentModel/chatInstructionAttachmentsModel.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/chat/browser/chatAttachmentModel/chatInstructionAttachmentsModel.ts b/src/vs/workbench/contrib/chat/browser/chatAttachmentModel/chatInstructionAttachmentsModel.ts index 0bfa66a79f0df..b0bc196ebc46c 100644 --- a/src/vs/workbench/contrib/chat/browser/chatAttachmentModel/chatInstructionAttachmentsModel.ts +++ b/src/vs/workbench/contrib/chat/browser/chatAttachmentModel/chatInstructionAttachmentsModel.ts @@ -30,13 +30,13 @@ const toChatVariable = ( reference: Pick, isRoot: boolean, ): IChatRequestVariableEntry => { - const { uri } = reference; + const { uri, isPromptSnippet } = reference; // default `id` is the stringified `URI` let id = `${uri}`; // for prompt files, we add a prefix to the `id` - if (reference.isPromptSnippet) { + if (isPromptSnippet) { // the default prefix that is used for all prompt files let prefix = 'vscode.prompt.instructions'; // if the reference is the root object, add the `.root` suffix @@ -57,7 +57,7 @@ const toChatVariable = ( enabled: true, isFile: true, isDynamic: true, - isMarkedReadonly: true, + isMarkedReadonly: isPromptSnippet, }; };