CorrectionApplicability enum

How broadly a CorrectionProducer can be applied.

Each value of this enum is cumulative, as the index increases, except for CorrectionApplicability.automaticallyButOncePerFile. When a correction producer has a given applicability, it also can be applied with each lower-indexed value. For example, a correction producer with an applicability of CorrectionApplicability.acrossFiles can also be used to apply corrections across a single file (CorrectionApplicability.singleLocation) and at a single location (CorrectionApplicability.singleLocation). The CorrectionProducer getters reflect this property: CorrectionProducer.canBeAppliedAcrossSingleFile, CorrectionProducer.canBeAppliedAcrossFiles, CorrectionProducer.canBeAppliedAutomatically.

Note that CorrectionApplicability.automaticallyButOncePerFile is the one value that does not have this cumulative property.

Inheritance
Available extensions

Values

singleLocation → const CorrectionApplicability

Indicates a correction can be applied only at a specific location.

A correction with this applicability is not applicable across a file, across multiple files, or valid to be applied automatically.

acrossSingleFile → const CorrectionApplicability

Indicates a correction can be applied in multiple positions in the same file.

A correction with this applicability is also applicable at a specific location, but not applicable across multiple files, or valid to be applied automatically.

This flag is used to provide the option for a user to fix a specific diagnostic across a file (such as a quick fix to "fix all something in this file").

acrossFiles → const CorrectionApplicability

Indicates a correction can be applied across in bulk across multiple files and/or at the same time as applying fixes from other producers.

A correction with this applicability is also applicable at a specific location, and across a file, but not valid to be applied automatically.

Cases where this is not applicable include fixes for which

  • the modified regions can overlap, and
  • fixes that have not been tested to ensure that they can be used this way.
automatically → const CorrectionApplicability

Indicates a correction can be applied in multiple locations, even if not chosen explicitly as a tool action, and can be applied to potentially incomplete code.

A correction with this applicability is also applicable at a specific location, and across a file, and across multiple files.

automaticallyButOncePerFile → const CorrectionApplicability

Indicates a correction can be applied in multiple files, except only one location per file; the correction can be applied even if not chosen explicitly as a tool action, and can be applied to potentially incomplete code.

A correction with this applicability is also applicable at a specific location, and across multiple files.

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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

Constants

values → const List<CorrectionApplicability>
A constant List of the values in this enum, in order of their declaration.