diff --git a/packages/plugin-ext/src/plugin/plugin-context.ts b/packages/plugin-ext/src/plugin/plugin-context.ts index 08969dd8b77b8..4ebc414f569d5 100644 --- a/packages/plugin-ext/src/plugin/plugin-context.ts +++ b/packages/plugin-ext/src/plugin/plugin-context.ts @@ -82,6 +82,7 @@ import { CodeLens, CodeActionKind, CodeActionTrigger, + CodeActionTriggerKind, TextDocumentSaveReason, CodeAction, TreeItem, @@ -896,6 +897,7 @@ export function createAPIFactory( CodeLens, CodeActionKind, CodeActionTrigger, + CodeActionTriggerKind, TextDocumentSaveReason, CodeAction, TreeItem, diff --git a/packages/plugin-ext/src/plugin/types-impl.ts b/packages/plugin-ext/src/plugin/types-impl.ts index 5b039ddca5652..deddabecd5c2c 100644 --- a/packages/plugin-ext/src/plugin/types-impl.ts +++ b/packages/plugin-ext/src/plugin/types-impl.ts @@ -1012,6 +1012,24 @@ export enum CodeActionTrigger { Manual = 2, } +/** + * The reason why code actions were requested. + */ +export enum CodeActionTriggerKind { + /** + * Code actions were explicitly requested by the user or by an extension. + */ + Invoke = 1, + + /** + * Code actions were requested automatically. + * + * This typically happens when current selection in a file changes, but can + * also be triggered when file content changes. + */ + Automatic = 2, +} + export class CodeActionKind { private static readonly sep = '.';