Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CodeActionProvider

The code action interface defines the contract between extensions and the light bulb feature.

A code action can be any command that is known to the system.

Hierarchy

  • CodeActionProvider

Index

Methods

provideCodeActions

  • Provide commands for the given document and range.

    Parameters

    • document: TextDocument

      The document in which the command was invoked.

    • range: Range | Selection

      The selector or range for which the command was invoked. This will always be a selection if there is a currently active editor.

    • context: CodeActionContext

      Context carrying additional information.

    • token: CancellationToken | undefined

      A cancellation token.

    Returns ProviderResult<(Command | CodeAction)[]>

    An array of commands, quick fixes, or refactorings or a thenable of such. The lack of a result can be signaled by returning undefined, null, or an empty array.