Skip to content

Commit

Permalink
move API to final, #106410
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Sep 25, 2020
1 parent 1e1f14f commit 1fd7ee1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 25 deletions.
18 changes: 17 additions & 1 deletion src/vs/vscode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2221,7 +2221,7 @@ declare module 'vscode' {
*
* A code action can be any command that is [known](#commands.getCommands) to the system.
*/
export interface CodeActionProvider {
export interface CodeActionProvider<T extends CodeAction = CodeAction> {
/**
* Provide commands for the given document and range.
*
Expand All @@ -2234,6 +2234,22 @@ declare module 'vscode' {
* signaled by returning `undefined`, `null`, or an empty array.
*/
provideCodeActions(document: TextDocument, range: Range | Selection, context: CodeActionContext, token: CancellationToken): ProviderResult<(Command | CodeAction)[]>;

/**
* Given a code action fill in its [`edit`](#CodeAction.edit)-property. Changes to
* all other properties, like title, are ignored. A code action that has an edit
* will not be resolved.
*
* *Note* that a code action provider that returns commands, not code actions, cannot successfully
* implement this function. Returning commands is deprecated and instead code actions should be
* returned.
*
* @param codeAction A code action.
* @param token A cancellation token.
* @return The resolved code action or a thenable that resolves to such. It is OK to return the given
* `item`. When no result is returned, the given `item` will be used.
*/
resolveCodeAction?(codeAction: T, token: CancellationToken): ProviderResult<T>;
}

/**
Expand Down
24 changes: 0 additions & 24 deletions src/vs/vscode.proposed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,6 @@

declare module 'vscode' {

//#region https://github.com/microsoft/vscode/issues/106410

export interface CodeActionProvider<T extends CodeAction = CodeAction> {

/**
* Given a code action fill in its [`edit`](#CodeAction.edit)-property, changes to
* all other properties, like title, are ignored. A code action that has an edit
* will not be resolved.
*
* *Note* that a code action provider that returns commands, not code actions, cannot successfully
* implement this function. Returning commands is deprecated and instead code actions should be
* returned.
*
* @param codeAction A code action.
* @param token A cancellation token.
* @return The resolved code action or a thenable that resolve to such. It is OK to return the given
* `item`. When no result is returned, the given `item` will be used.
*/
resolveCodeAction?(codeAction: T, token: CancellationToken): ProviderResult<T>;
}

//#endregion


// #region auth provider: https://github.com/microsoft/vscode/issues/88309

/**
Expand Down

0 comments on commit 1fd7ee1

Please sign in to comment.