Skip to content

Commit

Permalink
plugin-ext: Add CodeActionTriggerKind enum
Browse files Browse the repository at this point in the history
This commit adds the missing `CodeActionTriggerKind` enum.

Signed-off-by: Duc Nguyen <duc.a.nguyen@ericsson.com>
  • Loading branch information
DucNgn authored and vince-fugnitto committed Apr 28, 2021
1 parent b83b9b2 commit ce8b208
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/plugin-ext/src/plugin/plugin-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ import {
CodeLens,
CodeActionKind,
CodeActionTrigger,
CodeActionTriggerKind,
TextDocumentSaveReason,
CodeAction,
TreeItem,
Expand Down Expand Up @@ -896,6 +897,7 @@ export function createAPIFactory(
CodeLens,
CodeActionKind,
CodeActionTrigger,
CodeActionTriggerKind,
TextDocumentSaveReason,
CodeAction,
TreeItem,
Expand Down
18 changes: 18 additions & 0 deletions packages/plugin-ext/src/plugin/types-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '.';

Expand Down

0 comments on commit ce8b208

Please sign in to comment.