Skip to content

Commit

Permalink
make non-prompt file references non-readonly by default (#239138)
Browse files Browse the repository at this point in the history
[prompts]: make non-prompt file references non-readonly by default
  • Loading branch information
legomushroom authored Jan 29, 2025
1 parent d399651 commit 9b9093e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ const toChatVariable = (
reference: Pick<IPromptFileReference, 'uri' | 'isPromptSnippet'>,
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
Expand All @@ -57,7 +57,7 @@ const toChatVariable = (
enabled: true,
isFile: true,
isDynamic: true,
isMarkedReadonly: true,
isMarkedReadonly: isPromptSnippet,
};
};

Expand Down

0 comments on commit 9b9093e

Please sign in to comment.