Interface CodeActionProvider

Expand description

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

interface CodeActionProvider {
    provideCodeActions(
        model: ITextModel,
        range: Range,
        context: CodeActionContext,
        token: CancellationToken,
    ): ProviderResult<CodeActionList>;
    resolveCodeAction?(
        codeAction: CodeAction,
        token: CancellationToken,
    ): ProviderResult<CodeAction>;
}

Methods§

§

provideCodeActions(
    model: ITextModel,
    range: Range,
    context: CodeActionContext,
    token: CancellationToken,
): ProviderResult<CodeActionList>

Provide commands for the given document and range.

§

resolveCodeAction?(
    codeAction: CodeAction,
    token: CancellationToken,
): ProviderResult<CodeAction>

Given a code action fill in the edit. Will only invoked when missing.