CodeAction

open class CodeAction(source)

A code action represents a change that can be performed in code, e.g. to fix a problem or to refactor code.

A CodeAction must set either {@linkcode CodeAction.edit edit} and/or a {@linkcode CodeAction.command command}. If both are supplied, the edit is applied first, then the command is executed.

Online Documentation

Constructors

Link copied to clipboard
constructor(title: String, kind: CodeActionKind = definedExternally)

Creates a new code action.

Properties

Link copied to clipboard

A Command this code action executes.

Link copied to clipboard

Diagnostics that this code action resolves.

Link copied to clipboard

A workspace edit this code action performs.

Link copied to clipboard

Marks this as a preferred action. Preferred actions are used by the auto fix command and can be targeted by keybindings.

Link copied to clipboard

Kind of the code action.

Link copied to clipboard

A short, human-readable, title for this code action.