Skip to content

Commit f895a48

Browse files
committed
Revert api files
1 parent f844dba commit f895a48

File tree

3 files changed

+13
-201
lines changed

3 files changed

+13
-201
lines changed

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

Lines changed: 11 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -11,45 +11,16 @@ declare module 'vscode' {
1111
export namespace chat {
1212

1313
/**
14-
* Register a chat workspace context provider. Workspace context is automatically included in all chat requests.
14+
* Register a chat context provider. Chat context can be provided:
15+
* - For a resource. Make sure to pass a selector that matches the resource you want to provide context for.
16+
* Providers registered without a selector will not be called for resource-based context.
17+
* - Explicitly. These context items are shown as options when the user explicitly attaches context.
1518
*
1619
* To ensure your extension is activated when chat context is requested, make sure to include the following activations events:
1720
* - If your extension implements `provideWorkspaceChatContext` or `provideChatContextForResource`, find an activation event which is a good signal to activate.
1821
* Ex: `onLanguage:<languageId>`, `onWebviewPanel:<viewType>`, etc.`
1922
* - If your extension implements `provideChatContextExplicit`, your extension will be automatically activated when the user requests explicit context.
2023
*
21-
* @param id Unique identifier for the provider.
22-
* @param provider The chat workspace context provider.
23-
*/
24-
export function registerChatWorkspaceContextProvider(id: string, provider: ChatWorkspaceContextProvider): Disposable;
25-
26-
/**
27-
* Register a chat explicit context provider. Explicit context items are shown as options when the user explicitly attaches context.
28-
*
29-
* To ensure your extension is activated when chat context is requested, make sure to include the `onChatContextProvider:<id>` activation event in your `package.json`.
30-
*
31-
* @param id Unique identifier for the provider.
32-
* @param provider The chat explicit context provider.
33-
*/
34-
export function registerChatExplicitContextProvider(id: string, provider: ChatExplicitContextProvider): Disposable;
35-
36-
/**
37-
* Register a chat resource context provider. Resource context is provided for a specific resource.
38-
* Make sure to pass a selector that matches the resource you want to provide context for.
39-
*
40-
* To ensure your extension is activated when chat context is requested, make sure to include the `onChatContextProvider:<id>` activation event in your `package.json`.
41-
*
42-
* @param selector Document selector to filter which resources the provider is called for.
43-
* @param id Unique identifier for the provider.
44-
* @param provider The chat resource context provider.
45-
*/
46-
export function registerChatResourceContextProvider(selector: DocumentSelector, id: string, provider: ChatResourceContextProvider): Disposable;
47-
48-
/**
49-
* Register a chat context provider.
50-
*
51-
* @deprecated Use {@link registerChatWorkspaceContextProvider}, {@link registerChatExplicitContextProvider}, or {@link registerChatResourceContextProvider} instead.
52-
*
5324
* @param selector Optional document selector to filter which resources the provider is called for. If omitted, the provider will only be called for explicit context requests.
5425
* @param id Unique identifier for the provider.
5526
* @param provider The chat context provider.
@@ -86,24 +57,23 @@ declare module 'vscode' {
8657
command?: Command;
8758
}
8859

89-
export interface ChatWorkspaceContextProvider<T extends ChatContextItem = ChatContextItem> {
60+
export interface ChatContextProvider<T extends ChatContextItem = ChatContextItem> {
9061

9162
/**
9263
* An optional event that should be fired when the workspace chat context has changed.
9364
*/
9465
onDidChangeWorkspaceChatContext?: Event<void>;
9566

9667
/**
68+
* TODO @API: should this be a separate provider interface?
69+
*
9770
* Provide a list of chat context items to be included as workspace context for all chat requests.
9871
* This should be used very sparingly to avoid providing useless context and to avoid using up the context window.
9972
* A good example use case is to provide information about which branch the user is working on in a source control context.
10073
*
10174
* @param token A cancellation token.
10275
*/
103-
provideChatContext(token: CancellationToken): ProviderResult<T[]>;
104-
}
105-
106-
export interface ChatExplicitContextProvider<T extends ChatContextItem = ChatContextItem> {
76+
provideWorkspaceChatContext?(token: CancellationToken): ProviderResult<T[]>;
10777

10878
/**
10979
* Provide a list of chat context items that a user can choose from. These context items are shown as options when the user explicitly attaches context.
@@ -112,18 +82,7 @@ declare module 'vscode' {
11282
*
11383
* @param token A cancellation token.
11484
*/
115-
provideChatContext(token: CancellationToken): ProviderResult<T[]>;
116-
117-
/**
118-
* If a chat context item is provided without a `value`, this method is called to resolve the `value` for the item.
119-
*
120-
* @param context The context item to resolve.
121-
* @param token A cancellation token.
122-
*/
123-
resolveChatContext(context: T, token: CancellationToken): ProviderResult<ChatContextItem>;
124-
}
125-
126-
export interface ChatResourceContextProvider<T extends ChatContextItem = ChatContextItem> {
85+
provideChatContextExplicit?(token: CancellationToken): ProviderResult<T[]>;
12786

12887
/**
12988
* Given a particular resource, provide a chat context item for it. This is used for implicit context (see the settings `chat.implicitContext.enabled` and `chat.implicitContext.suggestedContext`).
@@ -135,51 +94,15 @@ declare module 'vscode' {
13594
* @param options Options include the resource for which to provide context.
13695
* @param token A cancellation token.
13796
*/
138-
provideChatContext(options: { resource: Uri }, token: CancellationToken): ProviderResult<T | undefined>;
97+
provideChatContextForResource?(options: { resource: Uri }, token: CancellationToken): ProviderResult<T | undefined>;
13998

14099
/**
141-
* If a chat context item is provided without a `value`, this method is called to resolve the `value` for the item.
100+
* If a chat context item is provided without a `value`, from either of the `provide` methods, this method is called to resolve the `value` for the item.
142101
*
143102
* @param context The context item to resolve.
144103
* @param token A cancellation token.
145104
*/
146105
resolveChatContext(context: T, token: CancellationToken): ProviderResult<ChatContextItem>;
147106
}
148107

149-
/**
150-
* @deprecated Use {@link ChatWorkspaceContextProvider}, {@link ChatExplicitContextProvider}, or {@link ChatResourceContextProvider} instead.
151-
*/
152-
export interface ChatContextProvider<T extends ChatContextItem = ChatContextItem> {
153-
154-
/**
155-
* An optional event that should be fired when the workspace chat context has changed.
156-
* @deprecated Use {@link ChatWorkspaceContextProvider.onDidChangeWorkspaceChatContext} instead.
157-
*/
158-
onDidChangeWorkspaceChatContext?: Event<void>;
159-
160-
/**
161-
* Provide a list of chat context items to be included as workspace context for all chat requests.
162-
* @deprecated Use {@link ChatWorkspaceContextProvider.provideChatContext} instead.
163-
*/
164-
provideWorkspaceChatContext?(token: CancellationToken): ProviderResult<T[]>;
165-
166-
/**
167-
* Provide a list of chat context items that a user can choose from.
168-
* @deprecated Use {@link ChatExplicitContextProvider.provideChatContext} instead.
169-
*/
170-
provideChatContextExplicit?(token: CancellationToken): ProviderResult<T[]>;
171-
172-
/**
173-
* Given a particular resource, provide a chat context item for it.
174-
* @deprecated Use {@link ChatResourceContextProvider.provideChatContext} instead.
175-
*/
176-
provideChatContextForResource?(options: { resource: Uri }, token: CancellationToken): ProviderResult<T | undefined>;
177-
178-
/**
179-
* If a chat context item is provided without a `value`, this method is called to resolve the `value` for the item.
180-
* @deprecated Use the `resolveChatContext` method on the specific provider type instead.
181-
*/
182-
resolveChatContext?(context: T, token: CancellationToken): ProviderResult<ChatContextItem>;
183-
}
184-
185108
}

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

Lines changed: 1 addition & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -96,108 +96,6 @@ declare module 'vscode' {
9696
constructor(title: string, message: string | MarkdownString, data: any, buttons?: string[]);
9797
}
9898

99-
/**
100-
* An option for a question in a carousel.
101-
*/
102-
export interface ChatQuestionOption {
103-
/**
104-
* Unique identifier for the option.
105-
*/
106-
id: string;
107-
/**
108-
* The display label for the option.
109-
*/
110-
label: string;
111-
/**
112-
* The value returned when this option is selected.
113-
*/
114-
value: unknown;
115-
}
116-
117-
/**
118-
* The type of question for a chat question carousel.
119-
*/
120-
export enum ChatQuestionType {
121-
/**
122-
* A free-form text input question.
123-
*/
124-
Text = 1,
125-
/**
126-
* A single-select question with radio buttons.
127-
*/
128-
SingleSelect = 2,
129-
/**
130-
* A multi-select question with checkboxes.
131-
*/
132-
MultiSelect = 3
133-
}
134-
135-
/**
136-
* A question to be displayed in a question carousel.
137-
*/
138-
export class ChatQuestion {
139-
/**
140-
* Unique identifier for the question.
141-
*/
142-
id: string;
143-
/**
144-
* The type of question: Text for free-form input, SingleSelect for radio buttons, MultiSelect for checkboxes.
145-
*/
146-
type: ChatQuestionType;
147-
/**
148-
* The title/header of the question.
149-
*/
150-
title: string;
151-
/**
152-
* Optional detailed message or description for the question.
153-
*/
154-
message?: string | MarkdownString;
155-
/**
156-
* Options for singleSelect or multiSelect questions.
157-
*/
158-
options?: ChatQuestionOption[];
159-
/**
160-
* The id(s) of the default selected option(s).
161-
* For SingleSelect, this should be a single option id.
162-
* For MultiSelect, this can be an array of option ids.
163-
*/
164-
defaultValue?: string | string[];
165-
/**
166-
* Whether to allow free-form text input in addition to predefined options.
167-
* When true, users can provide their own text answer even for SingleSelect or MultiSelect questions.
168-
*/
169-
allowFreeformInput?: boolean;
170-
171-
constructor(
172-
id: string,
173-
type: ChatQuestionType,
174-
title: string,
175-
options?: {
176-
message?: string | MarkdownString;
177-
options?: ChatQuestionOption[];
178-
defaultValue?: string | string[];
179-
allowFreeformInput?: boolean;
180-
}
181-
);
182-
}
183-
184-
/**
185-
* A carousel view for presenting multiple questions inline in the chat.
186-
* The UI is displayed but does not block the chat input.
187-
*/
188-
export class ChatResponseQuestionCarouselPart {
189-
/**
190-
* The questions to display in the carousel.
191-
*/
192-
questions: ChatQuestion[];
193-
/**
194-
* Whether users can skip answering the questions.
195-
*/
196-
allowSkip: boolean;
197-
198-
constructor(questions: ChatQuestion[], allowSkip?: boolean);
199-
}
200-
20199
export class ChatResponseCodeCitationPart {
202100
value: Uri;
203101
license: string;
@@ -346,7 +244,7 @@ declare module 'vscode' {
346244
constructor(uris: Uri[], callback: () => Thenable<unknown>);
347245
}
348246

349-
export type ExtendedChatResponsePart = ChatResponsePart | ChatResponseTextEditPart | ChatResponseNotebookEditPart | ChatResponseWorkspaceEditPart | ChatResponseConfirmationPart | ChatResponseCodeCitationPart | ChatResponseReferencePart2 | ChatResponseMovePart | ChatResponseExtensionsPart | ChatResponsePullRequestPart | ChatToolInvocationPart | ChatResponseMultiDiffPart | ChatResponseThinkingProgressPart | ChatResponseExternalEditPart | ChatResponseQuestionCarouselPart;
247+
export type ExtendedChatResponsePart = ChatResponsePart | ChatResponseTextEditPart | ChatResponseNotebookEditPart | ChatResponseWorkspaceEditPart | ChatResponseConfirmationPart | ChatResponseCodeCitationPart | ChatResponseReferencePart2 | ChatResponseMovePart | ChatResponseExtensionsPart | ChatResponsePullRequestPart | ChatToolInvocationPart | ChatResponseMultiDiffPart | ChatResponseThinkingProgressPart | ChatResponseExternalEditPart;
350248
export class ChatResponseWarningPart {
351249
value: MarkdownString;
352250
constructor(value: string | MarkdownString);
@@ -510,15 +408,6 @@ declare module 'vscode' {
510408
*/
511409
confirmation(title: string, message: string | MarkdownString, data: any, buttons?: string[]): void;
512410

513-
/**
514-
* Show an inline carousel of questions to gather information from the user.
515-
* This is a blocking call that waits for the user to submit or skip the questions.
516-
* @param questions Array of questions to display to the user
517-
* @param allowSkip Whether the user can skip questions without answering
518-
* @returns A promise that resolves with the user's answers, or undefined if skipped
519-
*/
520-
questionCarousel(questions: ChatQuestion[], allowSkip?: boolean): Thenable<Record<string, unknown> | undefined>;
521-
522411
/**
523412
* Push a warning to this stream. Short-hand for
524413
* `push(new ChatResponseWarningPart(message))`.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ declare module 'vscode' {
9797
*
9898
* This is also called on first load to get the initial set of items.
9999
*/
100-
refreshHandler: (token: CancellationToken) => Thenable<void>;
100+
refreshHandler: () => Thenable<void>;
101101

102102
/**
103103
* Fired when an item's archived state changes.

0 commit comments

Comments
 (0)