mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 13:29:44 +00:00
Add new API proposal for chat onDidPerformUserAction event (#183140)
* Add new API proposal for chat onDidPerformUserAction event * Enable API for tests that incidentally touch the getter
This commit is contained in:
parent
d867c0a0f4
commit
05c0ca95ed
|
@ -45,7 +45,8 @@
|
|||
"treeViewReveal",
|
||||
"workspaceTrust",
|
||||
"telemetry",
|
||||
"windowActivity"
|
||||
"windowActivity",
|
||||
"interactiveUserActions"
|
||||
],
|
||||
"private": true,
|
||||
"activationEvents": [],
|
||||
|
|
|
@ -1286,6 +1286,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
|
|||
return extHostChat.sendInteractiveRequestToProvider(providerId, message);
|
||||
},
|
||||
get onDidPerformUserAction() {
|
||||
checkProposedApiEnabled(extension, 'interactiveUserActions');
|
||||
return extHostChat.onDidPerformUserAction;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -50,6 +50,7 @@ export const allApiProposals = Object.freeze({
|
|||
inlineCompletionsAdditions: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts',
|
||||
interactive: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactive.d.ts',
|
||||
interactiveSlashCommands: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactiveSlashCommands.d.ts',
|
||||
interactiveUserActions: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactiveUserActions.d.ts',
|
||||
interactiveWindow: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactiveWindow.d.ts',
|
||||
ipc: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.ipc.d.ts',
|
||||
notebookCellExecutionState: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecutionState.d.ts',
|
||||
|
|
61
src/vscode-dts/vscode.proposed.interactive.d.ts
vendored
61
src/vscode-dts/vscode.proposed.interactive.d.ts
vendored
|
@ -153,65 +153,6 @@ declare module 'vscode' {
|
|||
provideResponseWithProgress(request: InteractiveRequest, progress: Progress<InteractiveProgress>, token: CancellationToken): ProviderResult<InteractiveResponseForProgress>;
|
||||
}
|
||||
|
||||
export enum InteractiveSessionVoteDirection {
|
||||
Up = 1,
|
||||
Down = 2
|
||||
}
|
||||
|
||||
export interface InteractiveSessionVoteAction {
|
||||
// eslint-disable-next-line local/vscode-dts-string-type-literals
|
||||
kind: 'vote';
|
||||
responseId: string;
|
||||
direction: InteractiveSessionVoteDirection;
|
||||
}
|
||||
|
||||
export enum InteractiveSessionCopyKind {
|
||||
// Keyboard shortcut or context menu
|
||||
Action = 1,
|
||||
Toolbar = 2
|
||||
}
|
||||
|
||||
export interface InteractiveSessionCopyAction {
|
||||
// eslint-disable-next-line local/vscode-dts-string-type-literals
|
||||
kind: 'copy';
|
||||
responseId: string;
|
||||
codeBlockIndex: number;
|
||||
copyType: InteractiveSessionCopyKind;
|
||||
copiedCharacters: number;
|
||||
totalCharacters: number;
|
||||
copiedText: string;
|
||||
}
|
||||
|
||||
export interface InteractiveSessionInsertAction {
|
||||
// eslint-disable-next-line local/vscode-dts-string-type-literals
|
||||
kind: 'insert';
|
||||
responseId: string;
|
||||
codeBlockIndex: number;
|
||||
totalCharacters: number;
|
||||
newFile?: boolean;
|
||||
}
|
||||
|
||||
export interface InteractiveSessionTerminalAction {
|
||||
// eslint-disable-next-line local/vscode-dts-string-type-literals
|
||||
kind: 'runInTerminal';
|
||||
responseId: string;
|
||||
codeBlockIndex: number;
|
||||
languageId?: string;
|
||||
}
|
||||
|
||||
export interface InteractiveSessionCommandAction {
|
||||
// eslint-disable-next-line local/vscode-dts-string-type-literals
|
||||
kind: 'command';
|
||||
command: InteractiveResponseCommand;
|
||||
}
|
||||
|
||||
export type InteractiveSessionUserAction = InteractiveSessionVoteAction | InteractiveSessionCopyAction | InteractiveSessionInsertAction | InteractiveSessionTerminalAction | InteractiveSessionCommandAction;
|
||||
|
||||
export interface InteractiveSessionUserActionEvent {
|
||||
action: InteractiveSessionUserAction;
|
||||
providerId: string;
|
||||
}
|
||||
|
||||
export interface InteractiveSessionDynamicRequest {
|
||||
/**
|
||||
* The message that will be displayed in the UI
|
||||
|
@ -235,7 +176,5 @@ declare module 'vscode' {
|
|||
export function sendInteractiveRequestToProvider(providerId: string, message: InteractiveSessionDynamicRequest): void;
|
||||
|
||||
export function registerInteractiveEditorSessionProvider(provider: InteractiveEditorSessionProvider): Disposable;
|
||||
|
||||
export const onDidPerformUserAction: Event<InteractiveSessionUserActionEvent>;
|
||||
}
|
||||
}
|
||||
|
|
70
src/vscode-dts/vscode.proposed.interactiveUserActions.d.ts
vendored
Normal file
70
src/vscode-dts/vscode.proposed.interactiveUserActions.d.ts
vendored
Normal file
|
@ -0,0 +1,70 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
declare module 'vscode' {
|
||||
|
||||
export enum InteractiveSessionVoteDirection {
|
||||
Up = 1,
|
||||
Down = 2
|
||||
}
|
||||
|
||||
export interface InteractiveSessionVoteAction {
|
||||
// eslint-disable-next-line local/vscode-dts-string-type-literals
|
||||
kind: 'vote';
|
||||
responseId: string;
|
||||
direction: InteractiveSessionVoteDirection;
|
||||
}
|
||||
|
||||
export enum InteractiveSessionCopyKind {
|
||||
// Keyboard shortcut or context menu
|
||||
Action = 1,
|
||||
Toolbar = 2
|
||||
}
|
||||
|
||||
export interface InteractiveSessionCopyAction {
|
||||
// eslint-disable-next-line local/vscode-dts-string-type-literals
|
||||
kind: 'copy';
|
||||
responseId: string;
|
||||
codeBlockIndex: number;
|
||||
copyType: InteractiveSessionCopyKind;
|
||||
copiedCharacters: number;
|
||||
totalCharacters: number;
|
||||
copiedText: string;
|
||||
}
|
||||
|
||||
export interface InteractiveSessionInsertAction {
|
||||
// eslint-disable-next-line local/vscode-dts-string-type-literals
|
||||
kind: 'insert';
|
||||
responseId: string;
|
||||
codeBlockIndex: number;
|
||||
totalCharacters: number;
|
||||
newFile?: boolean;
|
||||
}
|
||||
|
||||
export interface InteractiveSessionTerminalAction {
|
||||
// eslint-disable-next-line local/vscode-dts-string-type-literals
|
||||
kind: 'runInTerminal';
|
||||
responseId: string;
|
||||
codeBlockIndex: number;
|
||||
languageId?: string;
|
||||
}
|
||||
|
||||
export interface InteractiveSessionCommandAction {
|
||||
// eslint-disable-next-line local/vscode-dts-string-type-literals
|
||||
kind: 'command';
|
||||
command: InteractiveResponseCommand;
|
||||
}
|
||||
|
||||
export type InteractiveSessionUserAction = InteractiveSessionVoteAction | InteractiveSessionCopyAction | InteractiveSessionInsertAction | InteractiveSessionTerminalAction | InteractiveSessionCommandAction;
|
||||
|
||||
export interface InteractiveSessionUserActionEvent {
|
||||
action: InteractiveSessionUserAction;
|
||||
providerId: string;
|
||||
}
|
||||
|
||||
export namespace interactive {
|
||||
export const onDidPerformUserAction: Event<InteractiveSessionUserActionEvent>;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue