Improve Edit Query flow with automatic query updates via UpdateQueryTool #7792
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The "Edit with Copilot" feature in the query editor was inconvenient because it only opened chat with a pre-populated message but provided no automatic way to apply suggested changes back to the query settings. Users had to manually copy/paste between chat and the query editor, breaking the workflow.
This PR introduces an
UpdateQueryTool
that allows Copilot to automatically update GitHub search queries in VS Code settings during chat sessions.Key Changes
UpdateQueryTool (
src/lm/tools/updateQueryTool.ts
):namespace
,queryName
, andnewQuery
parametersEnhanced Chat Context (
src/common/settingsUtils.ts
):openCopilotForQuery()
to provide specific context about which query is being editedTool Registration (
src/lm/tools/tools.ts
):User Experience Improvement
Before: User clicks "Edit with Copilot" → Chat opens → User describes changes → Copilot suggests new query → User must manually copy/paste back to editor
After: User clicks "Edit with Copilot" → Chat opens with context → User describes changes → Copilot automatically updates the query using the tool → Query is instantly applied
Example Interaction
User: "Add assignee:@me to this query"
Copilot calls the
update_query
tool with the enhanced query, and the user immediately sees:"✅ Successfully updated query 'My Pull Requests' from 'is:pr state:open' to 'is:pr state:open assignee:@me'"
This eliminates the manual copy/paste step and keeps users in the natural chat flow while making real changes to their configuration.
Fixes #7749.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.