Skip to content

cleanup for prompt file variables#300185

Merged
aeschli merged 1 commit intomainfrom
aeschli/loud-fly-826
Mar 9, 2026
Merged

cleanup for prompt file variables#300185
aeschli merged 1 commit intomainfrom
aeschli/loud-fly-826

Conversation

@aeschli
Copy link
Contributor

@aeschli aeschli commented Mar 9, 2026

Copilot AI review requested due to automatic review settings March 9, 2026 14:13
@aeschli aeschli enabled auto-merge (squash) March 9, 2026 14:13
@aeschli aeschli self-assigned this Mar 9, 2026
@vs-code-engineering vs-code-engineering bot added this to the 1.112.0 milestone Mar 9, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR cleans up and renames internal chat “prompt/instructions” variable identifiers and related helper naming, aligning terminology toward a “customizations index” and new prompt-file variable kind prefixes.

Changes:

  • Renamed the automatic “instructions list” prompt-text variable creation to “customizations index”.
  • Updated PromptFileVariableKind string prefixes and prompt-text variable id/name/modelDescription to match new naming.
  • Refactored ext host prompt reference conversion to reuse toPromptFileVariableEntry.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.ts Renames the generated prompt-text variable from “instructions list” to “customizations index”.
src/vs/workbench/contrib/chat/common/attachments/chatVariableEntries.ts Updates prompt/instruction variable kind IDs and prompt-text variable metadata.
src/vs/workbench/api/common/extHostChatSessions.ts Switches prompt-file reference conversion to shared helper (toPromptFileVariableEntry).

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +711 to 721
if (URI.isUri(value) && ref.name.startsWith(`prompt:`)) {
if (ref.id.startsWith(PromptFileVariableKind.Instruction)) {
return toPromptFileVariableEntry(value, PromptFileVariableKind.Instruction);
}
if (ref.id.startsWith(PromptFileVariableKind.InstructionReference)) {
return toPromptFileVariableEntry(value, PromptFileVariableKind.InstructionReference);
}
if (ref.id.startsWith(PromptFileVariableKind.PromptFile)) {
return toPromptFileVariableEntry(value, PromptFileVariableKind.PromptFile);
}
}
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convertReferenceToVariable computes range from ref.range, but the new prompt-file branch returns toPromptFileVariableEntry(...) without preserving that range. This drops the offset-range information for explicitly typed prompt variables and can break dynamic-variable tracking/highlighting. Consider merging range into the returned entry (or extending toPromptFileVariableEntry to accept an optional range).

Copilot uses AI. Check for mistakes.
@aeschli aeschli merged commit 2d85f43 into main Mar 9, 2026
22 of 23 checks passed
@aeschli aeschli deleted the aeschli/loud-fly-826 branch March 9, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants