Skip to content

Commit e7842ca

Browse files
committed
Merge branch 'main' into alexr00/deep-cuckoo
2 parents fdeeeca + 34d7256 commit e7842ca

13 files changed

+259
-49
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## 0.134.0
4+
5+
### Changes
6+
7+
- Branch names in the create PR view are now cached for faster target branch loading.
8+
- GitHub permalink links in PR and issue overview webviews now open the corresponding local file when the file exists in the workspace.
9+
10+
### Fixes
11+
12+
- Selecting a target branch when creating a PR is sometimes broken. https://github.com/microsoft/vscode-pull-request-github/issues/8627
13+
- "Apply suggestion using AI" for code comment reviews results in a redundant disclaimer suffix. https://github.com/microsoft/vscode-pull-request-github/issues/8605
14+
15+
**_Thank You_**
16+
17+
* [@Daniel-Aaron-Bloom](https://github.com/Daniel-Aaron-Bloom): Link to local file for permalinks in webview [PR #8583](https://github.com/microsoft/vscode-pull-request-github/pull/8583)
18+
319
## 0.132.2
420

521
### Fixes

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"treeItemMarkdownLabel",
4545
"treeViewMarkdownMessage"
4646
],
47-
"version": "0.132.2",
47+
"version": "0.134.0",
4848
"publisher": "GitHub",
4949
"engines": {
5050
"vscode": "^1.110.0"
@@ -4103,6 +4103,33 @@
41034103
]
41044104
},
41054105
"when": "config.githubPullRequests.experimental.chat"
4106+
},
4107+
{
4108+
"name": "github-pull-request_resolveReviewThread",
4109+
"tags": [
4110+
"github",
4111+
"pull request",
4112+
"review"
4113+
],
4114+
"toolReferenceName": "resolveReviewThread",
4115+
"displayName": "%languageModelTools.github-pull-request_resolveReviewThread.displayName%",
4116+
"modelDescription": "Resolve a review thread on the active GitHub pull request. Use the threadId from the reviewThreads array returned by the activePullRequest tool. Only resolves threads where canResolve is true and isResolved is false.",
4117+
"icon": "$(pass)",
4118+
"canBeReferencedInPrompt": true,
4119+
"userDescription": "%languageModelTools.github-pull-request_resolveReviewThread.description%",
4120+
"when": "config.githubPullRequests.experimental.chat",
4121+
"inputSchema": {
4122+
"type": "object",
4123+
"properties": {
4124+
"threadId": {
4125+
"type": "string",
4126+
"description": "The GraphQL node ID of the review thread to resolve. Obtain this from the id field in the reviewThreads array of the activePullRequest tool output."
4127+
}
4128+
},
4129+
"required": [
4130+
"threadId"
4131+
]
4132+
}
41064133
}
41074134
]
41084135
},
@@ -4240,7 +4267,7 @@
42404267
"overrides": {
42414268
"mocha": {
42424269
"diff": "7.0.0",
4243-
"serialize-javascript": "6.0.1"
4270+
"serialize-javascript": "7.0.5"
42444271
},
42454272
"elliptic": "6.6.1"
42464273
},

package.nls.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,8 @@
446446
"languageModelTools.github-pull-request_pullRequestStatusChecks.description": "Get the status checks and CI results for a GitHub pull request.",
447447
"languageModelTools.github-pull-request_openPullRequest.displayName": "Open Pull Request",
448448
"languageModelTools.github-pull-request_openPullRequest.description": "Get information about the open GitHub pull request. This information includes: comments, files changed, pull request title + description, and pull request state.",
449+
"languageModelTools.github-pull-request_resolveReviewThread.displayName": "Resolve Review Thread",
450+
"languageModelTools.github-pull-request_resolveReviewThread.description": "Resolve a review thread on the active GitHub pull request.",
449451
"languageModelTools.github-pull-request_create_pull_request.displayName": "Create a GitHub pull request",
450452
"languageModelTools.github-pull-request_create_pull_request.description": "Create a new GitHub pull request with a title, head branch, and optional body, base branch, and draft flag."
451453
}

src/@types/vscode.proposed.chatParticipantAdditions.d.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -990,10 +990,6 @@ declare module 'vscode' {
990990
readonly toolReferences?: readonly ChatLanguageModelToolReference[];
991991
}
992992

993-
export interface ChatResultFeedback {
994-
readonly unhelpfulReason?: string;
995-
}
996-
997993
export namespace lm {
998994
export function fileIsIgnored(uri: Uri, token?: CancellationToken): Thenable<boolean>;
999995
}

src/@types/vscode.proposed.chatParticipantPrivate.d.ts

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ declare module 'vscode' {
5050
constructor(cell: TextDocument);
5151
}
5252

53-
export interface ChatRequestSessionGrouping {
54-
readonly id: string;
55-
readonly order: number;
56-
readonly kind?: string;
57-
}
58-
5953
export interface ChatRequest {
6054
/**
6155
* The id of the chat request. Used to identity an interaction with any of the chat surfaces.
@@ -122,11 +116,6 @@ declare module 'vscode' {
122116
*/
123117
readonly parentRequestId?: string;
124118

125-
/**
126-
* Optional metadata used to group related requests together in the UI.
127-
*/
128-
readonly sessionGrouping?: ChatRequestSessionGrouping;
129-
130119
/**
131120
* The permission level for tool auto-approval in this request.
132121
* - `'autoApprove'`: Auto-approve all tool calls and retry on errors.
@@ -199,10 +188,15 @@ declare module 'vscode' {
199188
*/
200189
readonly modelId?: string;
201190

191+
/**
192+
* The mode instructions that were active for this request, if any.
193+
*/
194+
readonly modeInstructions2?: ChatRequestModeInstructions;
195+
202196
/**
203197
* @hidden
204198
*/
205-
constructor(prompt: string, command: string | undefined, references: ChatPromptReference[], participant: string, toolReferences: ChatLanguageModelToolReference[], editedFileEvents: ChatRequestEditedFileEvent[] | undefined, id: string | undefined, modelId: string | undefined);
199+
constructor(prompt: string, command: string | undefined, references: ChatPromptReference[], participant: string, toolReferences: ChatLanguageModelToolReference[], editedFileEvents: ChatRequestEditedFileEvent[] | undefined, id: string | undefined, modelId: string | undefined, modeInstructions2: ChatRequestModeInstructions | undefined);
206200
}
207201

208202
export class ChatResponseTurn2 {
@@ -421,4 +415,17 @@ declare module 'vscode' {
421415
}
422416

423417
// #endregion
418+
419+
export interface LanguageModelToolInformation {
420+
/**
421+
* The full reference name of this tool as used in agent definition files.
422+
*
423+
* For MCP tools, this is the canonical name in the format `serverShortName/toolReferenceName`
424+
* (e.g., `github/search_issues`). This can be used to map between the tool names specified
425+
* in agent `.md` files and the tool's internal {@link LanguageModelToolInformation.name id}.
426+
*
427+
* This property is only set for MCP tools. For other tool types, it is `undefined`.
428+
*/
429+
readonly fullReferenceName?: string;
430+
}
424431
}

src/@types/vscode.proposed.chatSessionsProvider.d.ts

Lines changed: 76 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,36 @@ declare module 'vscode' {
100100
readonly command?: string;
101101
};
102102

103+
/**
104+
* @deprecated Use `inputState` instead
105+
*/
103106
readonly sessionOptions: ReadonlyArray<{ optionId: string; value: string | ChatSessionProviderOptionItem }>;
107+
108+
readonly inputState: ChatSessionInputState;
104109
}
105110

106111
/**
107112
* Extension callback invoked when a new chat session is started.
108113
*/
109114
export type ChatSessionItemControllerNewItemHandler = (context: ChatSessionItemControllerNewItemHandlerContext, token: CancellationToken) => Thenable<ChatSessionItem>;
110115

116+
/**
117+
* Extension callback invoked to get the input state for a chat session.
118+
*
119+
* @param sessionResource The resource of the chat session to get the input state for. `undefined` indicates this is
120+
* for a blank chat editor that is not yet associated with a session.
121+
* @param context Additional context
122+
* @param token Cancellation token.
123+
*
124+
* @return A new chat session input state. This should be created using {@link ChatSessionItemController.createChatSessionInputState}.
125+
*/
126+
export type ChatSessionControllerGetInputState = (sessionResource: Uri | undefined, context: {
127+
/**
128+
* The previous input state for the session.
129+
*/
130+
readonly previousInputState: ChatSessionInputState | undefined;
131+
}, token: CancellationToken) => Thenable<ChatSessionInputState> | ChatSessionInputState;
132+
111133
/**
112134
* Extension callback invoked to fork an existing chat session item managed by a {@linkcode ChatSessionItemController}.
113135
*
@@ -150,6 +172,11 @@ declare module 'vscode' {
150172
*/
151173
readonly refreshHandler: ChatSessionItemControllerRefreshHandler;
152174

175+
/**
176+
* Fired when an item's archived state changes.
177+
*/
178+
readonly onDidChangeChatSessionItemState: Event<ChatSessionItem>;
179+
153180
/**
154181
* Invoked when a new chat session is started.
155182
*
@@ -168,9 +195,14 @@ declare module 'vscode' {
168195
forkHandler?: ChatSessionItemControllerForkHandler;
169196

170197
/**
171-
* Fired when an item's archived state changes.
198+
* Gets the input state for a chat session.
172199
*/
173-
readonly onDidChangeChatSessionItemState: Event<ChatSessionItem>;
200+
getChatSessionInputState?: ChatSessionControllerGetInputState;
201+
202+
/**
203+
* Create a new managed ChatSessionInputState object.
204+
*/
205+
createChatSessionInputState(groups: ChatSessionProviderOptionGroup[]): ChatSessionInputState;
174206
}
175207

176208
/**
@@ -321,6 +353,9 @@ declare module 'vscode' {
321353
metadata?: { readonly [key: string]: any };
322354
}
323355

356+
/**
357+
* @deprecated Use `ChatSessionChangedFile2` instead
358+
*/
324359
export class ChatSessionChangedFile {
325360
/**
326361
* URI of the file.
@@ -468,11 +503,15 @@ declare module 'vscode' {
468503
*/
469504
export interface ChatSessionContentProvider {
470505
/**
506+
* @deprecated
507+
*
471508
* Event that the provider can fire to signal that the options for a chat session have changed.
472509
*/
473510
readonly onDidChangeChatSessionOptions?: Event<ChatSessionOptionChangeEvent>;
474511

475512
/**
513+
* @deprecated
514+
*
476515
* Event that the provider can fire to signal that the available provider options have changed.
477516
*
478517
* When fired, the editor will re-query {@link ChatSessionContentProvider.provideChatSessionProviderOptions}
@@ -492,17 +531,26 @@ declare module 'vscode' {
492531
* @return The {@link ChatSession chat session} associated with the given URI.
493532
*/
494533
provideChatSessionContent(resource: Uri, token: CancellationToken, context: {
534+
readonly inputState: ChatSessionInputState;
535+
536+
/**
537+
* @deprecated Use `inputState` instead
538+
*/
495539
readonly sessionOptions: ReadonlyArray<{ optionId: string; value: string | ChatSessionProviderOptionItem }>;
496540
}): Thenable<ChatSession> | ChatSession;
497541

498542
/**
543+
* @deprecated
544+
*
499545
* @param resource Identifier of the chat session being updated.
500546
* @param updates Collection of option identifiers and their new values. Only the options that changed are included.
501547
* @param token A cancellation token that can be used to cancel the notification if the session is disposed.
502548
*/
503549
provideHandleOptionsChange?(resource: Uri, updates: ReadonlyArray<ChatSessionOptionUpdate>, token: CancellationToken): void;
504550

505551
/**
552+
* @deprecated
553+
*
506554
* Called as soon as you register (call me once)
507555
*/
508556
provideChatSessionProviderOptions?(token: CancellationToken): Thenable<ChatSessionProviderOptions>;
@@ -614,10 +662,15 @@ declare module 'vscode' {
614662
*/
615663
readonly description?: string;
616664

665+
/**
666+
* The currently selected option for this group. This must be one of the items provided in the `items` array.
667+
*/
668+
readonly selected?: ChatSessionProviderOptionItem;
669+
617670
/**
618671
* The selectable items within this option group.
619672
*/
620-
readonly items: ChatSessionProviderOptionItem[];
673+
readonly items: readonly ChatSessionProviderOptionItem[];
621674

622675
/**
623676
* A context key expression that controls when this option group picker is visible.
@@ -654,6 +707,9 @@ declare module 'vscode' {
654707
* Optional commands.
655708
*
656709
* These commands will be displayed at the bottom of the group.
710+
*
711+
* For extensions that use the new `provideChatSessionInputState` API, these commands are passed a context object
712+
* `{ inputState: ChatSessionInputState; sessionResource: Uri | undefined }` that they can use to determine which session and options they are being invoked for.
657713
*/
658714
readonly commands?: Command[];
659715
}
@@ -672,4 +728,21 @@ declare module 'vscode' {
672728
*/
673729
readonly newSessionOptions?: Record<string, string | ChatSessionProviderOptionItem>;
674730
}
731+
732+
/**
733+
* Represents the current state of user inputs for a chat session.
734+
*/
735+
export interface ChatSessionInputState {
736+
/**
737+
* Fired when the input state is changed by the user.
738+
*/
739+
readonly onDidChange: Event<void>;
740+
741+
/**
742+
* The groups of options to show in the UI for user input.
743+
*
744+
* To update the groups you must replace the entire `groups` array with a new array.
745+
*/
746+
groups: readonly ChatSessionProviderOptionGroup[];
747+
}
675748
}

src/github/createPRViewProvider.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,19 +1161,14 @@ Don't forget to commit your template file to the repository so that it can be us
11611161
const activeItem = message.args.currentBranch ? quickPick.items.find(item => item.branch === message.args.currentBranch) : undefined;
11621162
quickPick.activeItems = activeItem ? [activeItem] : [];
11631163
}
1164-
await updateItems(githubRepository, undefined);
1165-
} else {
1166-
quickPick.items = await this.remotePicks(isBase);
11671164
}
1168-
const activeItem = message.args.currentBranch ? quickPick.items.find(item => item.branch === message.args.currentBranch) : undefined;
1169-
quickPick.activeItems = activeItem ? [activeItem] : [];
1170-
quickPick.busy = false;
1165+
// Register event handlers before awaiting async operations to avoid missing early user interactions
11711166
const remoteAndBranch: Promise<{ remote: RemoteInfo, branch: string } | undefined> = new Promise((resolve) => {
11721167
quickPick.onDidAccept(async () => {
1173-
if (quickPick.selectedItems.length === 0) {
1168+
const selectedPick = quickPick.selectedItems[0] ?? quickPick.activeItems[0];
1169+
if (!selectedPick) {
11741170
return;
11751171
}
1176-
const selectedPick = quickPick.selectedItems[0];
11771172
if (selectedPick.label === chooseDifferentRemote) {
11781173
quickPick.busy = true;
11791174
quickPick.items = await this.remotePicks(isBase);
@@ -1194,6 +1189,14 @@ Don't forget to commit your template file to the repository so that it can be us
11941189
});
11951190
});
11961191
const hidePromise = new Promise<void>((resolve) => quickPick.onDidHide(() => resolve()));
1192+
if (githubRepository) {
1193+
await updateItems(githubRepository, undefined);
1194+
} else {
1195+
quickPick.items = await this.remotePicks(isBase);
1196+
}
1197+
const activeItem = message.args.currentBranch ? quickPick.items.find(item => item.branch === message.args.currentBranch) : undefined;
1198+
quickPick.activeItems = activeItem ? [activeItem] : [];
1199+
quickPick.busy = false;
11971200
const result = await Promise.race([remoteAndBranch, hidePromise]);
11981201
if (!result || !githubRepository) {
11991202
quickPick.hide();

0 commit comments

Comments
 (0)