CodeAction class

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.editedit} and/or a {@linkcode CodeAction.commandcommand}. If both are supplied, the edit is applied first, then the command is executed.

Available extensions
Annotations
  • @JS()
  • @staticInterop

Constructors

CodeAction.new(String title, [CodeActionKind? kind])
factory

Properties

command Command

Available on CodeAction, provided by the CodeAction$Typings extension

A {@link Command} this code action executes.
getter/setter pair
diagnostics List<Diagnostic>

Available on CodeAction, provided by the CodeAction$Typings extension

{@link Diagnostic Diagnostics} that this code action resolves.
getter/setter pair
disabled ↔ dynamic

Available on CodeAction, provided by the CodeAction$Typings extension

Marks that the code action cannot currently be applied.
getter/setter pair
edit WorkspaceEdit

Available on CodeAction, provided by the CodeAction$Typings extension

A {@link WorkspaceEdit workspace edit} this code action performs.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isPreferred bool

Available on CodeAction, provided by the CodeAction$Typings extension

Marks this as a preferred action. Preferred actions are used by the auto fix command and can be targeted by keybindings.
getter/setter pair
kind CodeActionKind

Available on CodeAction, provided by the CodeAction$Typings extension

{@link CodeActionKind Kind} of the code action.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title String

Available on CodeAction, provided by the CodeAction$Typings extension

A short, human-readable, title for this code action.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited