Interface MonacoCodeActionService

interface MonacoCodeActionService {
    applyCodeActions(model, codeActionSets, token): Promise<void>;
    applyOnSaveCodeActions(model, languageId, uri, token): Promise<void>;
    getAllCodeActionsOnSave(model, languageId, uri, token): Promise<undefined | CodeActionSet[]>;
}

Implemented by

Methods

  • Applies the provided code actions for the given model.

    Parameters

    • model: ITextModel

      The text model to apply code actions to

    • codeActionSets: CodeActionSet[]

      Array of code action sets to apply

    • token: CancellationToken

      Cancellation token

    Returns Promise<void>

  • Applies all code actions that should be run on save for the given model and language identifier. This is a convenience method that retrieves all on-save code actions and applies them.

    Parameters

    • model: ITextModel

      The text model to apply code actions to

    • languageId: string

      The language identifier for preference lookup

    • uri: string

      The URI string for preference scoping

    • token: CancellationToken

      Cancellation token

    Returns Promise<void>

  • Gets all code actions that should be applied on save for the given model and language identifier.

    Parameters

    • model: ITextModel

      The text model to get code actions for

    • languageId: string

      The language identifier for preference lookup

    • uri: string

      The URI string for preference scoping

    • token: CancellationToken

      Cancellation token

    Returns Promise<undefined | CodeActionSet[]>

    Array of code action sets to apply, or undefined if no actions should be applied