ChangeBuilder class abstract
A builder used to build a SourceChange.
Clients may not extend, implement or mix-in this class.
Constructors
- ChangeBuilder({AnalysisSession session, ChangeWorkspace workspace, String eol})
-
Initializes a newly created change builder.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectionRange → SourceRange?
-
Return the range of the selection for the change being built, or
null
if there is no selection.no setter - sourceChange → SourceChange
-
Return the source change that was built. The source change will not be
complete until all of the futures returned by the add*FileEdit methods
have completed.
no setter
Methods
-
addDartFileEdit(
String path, FutureOr< void> buildFileEdit(DartFileEditBuilder builder), {ImportPrefixGenerator importPrefixGenerator, bool createEditsForImports = true}) → Future<void> -
Use the
buildFileEdit
function to create a collection of edits to the file with the givenpath
. The edits will be added to the source change that is being built. -
addGenericFileEdit(
String path, void buildFileEdit(FileEditBuilder builder)) → Future< void> -
Use the
buildFileEdit
function to create a collection of edits to the file with the givenpath
. The edits will be added to the source change that is being built. -
addYamlFileEdit(
String path, void buildFileEdit(YamlFileEditBuilder builder)) → Future< void> -
Use the
buildFileEdit
function to create a collection of edits to the file with the givenpath
. The edits will be added to the source change that is being built. -
copy(
) → ChangeBuilder - Return a copy of this change builder that is constructed in such as was that changes to the copy will not effect this change builder.
-
hasEditsFor(
String path) → bool -
Return
true
if this builder already has edits for the file with the givenpath
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setSelection(
Position position) → void -
Set the selection for the change being built to the given
position
. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited