Skip to content

Add file path and line context to "Apply suggestion using AI" prompt#8629

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/add-line-numbers-to-suggestions
Draft

Add file path and line context to "Apply suggestion using AI" prompt#8629
Copilot wants to merge 4 commits intomainfrom
copilot/add-line-numbers-to-suggestions

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 30, 2026

The AI suggestion prompt from code review comments was sending only the raw comment body, with no context about which file or lines the comment targets.

Now the message sent to Copilot includes file and line reference context:

There is a code review comment for file src/utils.ts at lines 42-45:
<comment body>
  • Extracts path and range from the comment thread to build a contextual prefix
  • Handles single-line (line 42), multi-line (lines 42-45), file-level (no range), and fallback (no path) cases
  • All new strings use vscode.l10n.t() for localization
  • Applies to both the inline chat path (single comments) and the Chat view path (threads)

Copilot AI changed the title [WIP] Add line numbers to code review comment suggestions Add file path and line context to "Apply suggestion using AI" prompt Mar 30, 2026
Copilot AI requested a review from alexr00 March 30, 2026 12:54
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.

"Apply suggestion using AI" for a code review comment could include line numbers referenced

2 participants