File tree Expand file tree Collapse file tree
editor/contrib/codeAction Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,8 +32,7 @@ export class CodeActionItem {
3232 ) { }
3333
3434 async resolve ( token : CancellationToken ) : Promise < this> {
35- // TODO@jrieken when is an item resolved already?
36- if ( this . provider ?. resolveCodeAction && ! this . action . edit && ! this . action . command ) {
35+ if ( this . provider ?. resolveCodeAction && ! this . action . edit ) {
3736 let action : modes . CodeAction | undefined | null ;
3837 try {
3938 action = await this . provider . resolveCodeAction ( this . action , token ) ;
Original file line number Diff line number Diff line change @@ -19,8 +19,21 @@ declare module 'vscode' {
1919 //#region https://github.com/microsoft/vscode/issues/106410
2020
2121 export interface CodeActionProvider < T extends CodeAction = CodeAction > {
22- // TODO@jrieken make it clear that there is no support for commands, only code action
23- // TODO@jrieken only edit can be set
22+
23+ /**
24+ * Given a code action fill in its [`edit`](#CodeAction.edit)-property, changes to
25+ * all other properties, like title, are ignored. A code action that has an edit
26+ * will not be resolved.
27+ *
28+ * *Note* that a code action provider that returns commands, not code actions, cannot successfully
29+ * implement this function. Returning commands is deprecated and instead code actions should be
30+ * returned.
31+ *
32+ * @param codeAction A code action.
33+ * @param token A cancellation token.
34+ * @return The resolved code action or a thenable that resolve to such. It is OK to return the given
35+ * `item`. When no result is returned, the given `item` will be used.
36+ */
2437 resolveCodeAction ?( codeAction : T , token : CancellationToken ) : ProviderResult < T > ;
2538 }
2639
You can’t perform that action at this time.
0 commit comments