Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 10, 2025

Adds support for selecting from multiple pull request templates when creating a PR. When a repository has multiple PR templates available, users can now choose which template to use.

Changes Made

  • Added templatePrompt option to the existing githubPullRequests.pullRequestDescription setting
  • Updated localization strings in package.nls.json for the new option
  • Added getAllPullRequestTemplates() method in folderRepositoryManager.ts to fetch all available templates
  • Updated createPRViewProvider.ts to show a quick pick selection when templatePrompt is selected and multiple templates exist

Behavior

  • template option: Uses the first template found (original behavior, backward compatible)
  • templatePrompt option: Shows a quick pick to select from available templates when multiple exist, otherwise uses the first template if only one exists
  • Other options (commit, none, Copilot): Continue to work as before

When templatePrompt is selected and multiple templates are available, a quick pick menu displays each template with:

  • A label extracted from the first line of the template
  • The template length in characters as a description

Testing

  • ✅ TypeScript compilation passes
  • ✅ Linting and hygiene checks pass
  • ✅ Build process completes successfully
  • Manual testing with a repository that has multiple PR templates
Original prompt

This section details on the original issue you should resolve

<issue_title>Support multiple PR templates</issue_title>
<issue_description>
Type: Feature Request

E.g., the https://github.com/python/peps/ repo has multiple PR templates to choose from depending on the purpose of the PR. It would be nice if a quick pick came up asking which template to use before opening up the UI to fill in the description.

(Apologies if this is a dupe; the issue reporter hit a GH query limit while I was typing in my title.)

Extension version: 0.101.2024110404
VS Code version: Code - Insiders 1.96.0-insider (231d37338a58ff22c223a7ed7d4c1e7142c513d2, 2024-11-04T14:19:41.196Z)
OS version: Windows_NT x64 10.0.26100
Modes:
Remote OS version: Linux x64 5.15.153.1-microsoft-standard-WSL2

<agent_instructions>Add a setting githubPullRequests.createFromTemplate with the values none, first, and prompt. </agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 10, 2025 11:46
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copy link
Member

@alexr00 alexr00 left a comment

Choose a reason for hiding this comment

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

@copilot Actually, we should reuse the setting githubPullRequests.pullRequestDescription. Instead, add a new option to it templatePrompt.

…RequestDescription

Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 16, 2025

@copilot Actually, we should reuse the setting githubPullRequests.pullRequestDescription. Instead, add a new option to it templatePrompt.

Updated to add templatePrompt as a new option to the existing githubPullRequests.pullRequestDescription setting instead of creating a separate setting. The template option continues to use the first template (original behavior), while templatePrompt shows a quick pick when multiple templates exist. Changes in commit 7fe6164.

Copilot AI changed the title [WIP] Add support for multiple PR templates selection Add support for multiple PR templates selection Dec 16, 2025
Copilot AI requested a review from alexr00 December 16, 2025 11:20
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.

Support multiple PR templates

2 participants