Skip to content

Add optional codeSelection property and refactor feedback comment#299005

Open
benibenj wants to merge 2 commits intomainfrom
copilot-worktree-2026-03-03T15-52-03
Open

Add optional codeSelection property and refactor feedback comment#299005
benibenj wants to merge 2 commits intomainfrom
copilot-worktree-2026-03-03T15-52-03

Conversation

@benibenj
Copy link
Contributor

@benibenj benibenj commented Mar 3, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 3, 2026 16:52
@vs-code-engineering vs-code-engineering bot added this to the March 2026 milestone Mar 3, 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

Adds support for carrying an optional code snippet alongside agent feedback attachment items, and refactors the Sessions “agent feedback” hover to render that snippet directly instead of trying to synchronously read editor models.

Changes:

  • Extend IAgentFeedbackVariableEntry.feedbackItems[] with an optional codeSelection?: string.
  • Refactor AgentFeedbackHover to use codeSelection for the hover code block and remove dependency on IModelService.
  • Populate codeSelection from the attachment contribution’s snippet cache when constructing the attachment entry.

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/attachments/chatVariableEntries.ts Adds optional codeSelection to agent feedback attachment item shape.
src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackHover.ts Uses codeSelection to render snippet in hover; removes model/range dependency.
src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackAttachment.ts Passes cached snippet into feedbackItems[].codeSelection when building attachment entry.

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