Skip to content

Commit 2f478f1

Browse files
Copilotalexr00
andauthored
Make setCheckboxState private since only internal callers use it
Agent-Logs-Url: https://github.com/microsoft/vscode-pull-request-github/sessions/f244f7e0-8ae9-4953-a049-959683511545 Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent de152be commit 2f478f1

File tree

4 files changed

+90
-8
lines changed

4 files changed

+90
-8
lines changed

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: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,4 +415,17 @@ declare module 'vscode' {
415415
}
416416

417417
// #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+
}
418431
}

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/view/treeNodes/directoryTreeNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export class DirectoryTreeNode extends TreeNode implements vscode.TreeItem {
131131
return true;
132132
}
133133

134-
public setCheckboxState(isChecked: boolean) {
134+
private setCheckboxState(isChecked: boolean) {
135135
this.checkboxState = isChecked ?
136136
{ state: vscode.TreeItemCheckboxState.Checked, tooltip: vscode.l10n.t('Mark all files unviewed'), accessibilityInformation: { label: vscode.l10n.t('Mark all files in folder {0} as unviewed', this.label!) } } :
137137
{ state: vscode.TreeItemCheckboxState.Unchecked, tooltip: vscode.l10n.t('Mark all files viewed'), accessibilityInformation: { label: vscode.l10n.t('Mark all files in folder {0} as viewed', this.label!) } };

0 commit comments

Comments
 (0)