DartEditBuilder class abstract
An EditBuilder used to build edits in Dart files.
Clients may not extend, implement or mix-in this class.
- Implemented types
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addLinkedEdit(
String groupName, void buildLinkedEdit(DartLinkedEditBuilder builder)) → void -
Add a region of text that is part of the linked edit group with the given
groupName
. ThebuildLinkedEdit
function is used to write the content of the region of text and to add suggestions for other possible values for that region.override -
addSimpleLinkedEdit(
String groupName, String text, {LinkedEditSuggestionKind kind, List< String> suggestions}) → void -
Add the given text as a linked edit group with the given
groupName
. If both akind
and a list ofsuggestions
are provided, they will be added as suggestions to the group with the given kind.inherited -
canWriteType(
DartType? type, {ExecutableElement? methodBeingCopied}) → bool -
Checks whether the code for a type annotation for the given
type
can be written. -
getIndent(
int level) → String -
Returns the indentation with the given
level
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
selectAll(
void writer()) → void -
Set the selection to cover all of the code written by the given
writer
.inherited -
selectHere(
) → void -
Set the selection to the current location within the edit being built.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
write(
String string) → void -
Add the given
string
to the content of the current edit.inherited -
writeClassDeclaration(
String name, {Iterable< DartType> ? interfaces, bool isAbstract = false, void membersWriter()?, Iterable<DartType> ? mixins, String? nameGroupName, DartType? superclass, String? superclassGroupName}) → void -
Writes the code for a declaration of a class with the given
name
. -
writeConstructorDeclaration(
String className, {ArgumentList? argumentList, void bodyWriter()?, String? classNameGroupName, String? constructorName, String? constructorNameGroupName, List< String> ? fieldNames, void initializerWriter()?, bool isConst = false, void parameterWriter()?}) → void -
Writes the code for a constructor declaration in the class with the given
className
. -
writeFieldDeclaration(
String name, {void initializerWriter()?, bool isConst = false, bool isFinal = false, bool isStatic = false, String? nameGroupName, DartType? type, String? typeGroupName}) → void -
Writes the code for a declaration of a field with the given
name
. -
writeFormalParameter(
String name, {bool isCovariant, bool isRequiredNamed, ExecutableElement2? methodBeingCopied, String? nameGroupName, DartType? type, String? typeGroupName, bool isRequiredType}) → void -
Writes the code for a single parameter with the given
name
. -
writeFormalParameters(
Iterable< FormalParameterElement> parameters, {ExecutableElement2? methodBeingCopied, bool includeDefaultValues = true, bool requiredTypes}) → void -
Writes the code for a list of
parameters
, including the surrounding parentheses and default values (unlessincludeDefaultValues
isfalse
). -
writeFunctionDeclaration(
String name, {void bodyWriter()?, bool isStatic = false, String? nameGroupName, void parameterWriter()?, DartType? returnType, String? returnTypeGroupName}) → void -
Writes the code for a declaration of a function with the given
name
. -
writeGetterDeclaration(
String name, {void bodyWriter(), bool isStatic = false, String nameGroupName, DartType returnType, String returnTypeGroupName}) → void -
Writes the code for a declaration of a getter with the given
name
. -
writeImportedName(
List< Uri> uris, String name) → void -
Writes the given
name
, possibly with a prefix, assuming that the name can be imported from any of the givenuris
. -
writeIndent(
[int level = 1]) → void -
Writes an indent, two spaces for every
level
. -
writeln(
[String string]) → void -
Add the given
string
to the content of the current edit and then add an end-of-line marker.inherited -
writeLocalVariableDeclaration(
String name, {void initializerWriter()?, bool isConst = false, bool isFinal = false, String? nameGroupName, DartType? type, String? typeGroupName}) → void -
Writes the code for a declaration of a local variable with the given
name
. -
writeMixinDeclaration(
String name, {Iterable< DartType> ? interfaces, void membersWriter()?, String? nameGroupName, Iterable<DartType> ? superclassConstraints}) → void -
Writes the code for a declaration of a mixin with the given
name
. -
writeOverride(
ExecutableElement element, {StringBuffer? displayTextBuffer, bool invokeSuper = false, bool setSelection = true}) → void -
Appends a placeholder for an override of the specified inherited
element
. -
writeOverride2(
ExecutableElement2 element, {StringBuffer? displayTextBuffer, bool invokeSuper = false, bool setSelection = true}) → void -
Appends a placeholder for an override of the specified inherited
element
. -
writeParameter(
String name, {bool isCovariant, bool isRequiredNamed, ExecutableElement? methodBeingCopied, String? nameGroupName, DartType? type, String? typeGroupName, bool isRequiredType}) → void -
Writes the code for a single parameter with the given
name
. -
writeParameterMatchingArgument(
Expression argument, int index, Set< String> usedNames) → void -
Writes the code for a parameter that would match the given
argument
. -
writeParameters(
Iterable< ParameterElement> parameters, {ExecutableElement? methodBeingCopied, bool includeDefaultValues = true, bool requiredTypes}) → void -
Writes the code for a list of
parameters
, including the surrounding parentheses and default values (unlessincludeDefaultValues
isfalse
). -
writeParametersMatchingArguments(
ArgumentList arguments) → void -
Writes the code for a list of parameters that would match the given list
of
arguments
. -
writeReference(
Element element) → void -
Writes the code that references the
element
. -
writeReference2(
Element2 element) → void -
Writes the code that references the
element
. -
writeSetterDeclaration(
String name, {void bodyWriter()?, bool isStatic = false, String? nameGroupName, DartType? parameterType, String? parameterTypeGroupName}) → void -
Writes the code for a declaration of a setter with the given
name
. -
writeType(
DartType? type, {bool addSupertypeProposals = false, String? groupName, ExecutableElement? methodBeingCopied, bool required = false}) → bool -
Writes the code for a type annotation for the given
type
. -
writeType2(
DartType? type, {bool addSupertypeProposals = false, String? groupName, ExecutableElement2? methodBeingCopied, bool required = false}) → bool -
Writes the code for a type annotation for the given
type
. -
writeTypeParameter(
TypeParameterElement typeParameter, {ExecutableElement? methodBeingCopied}) → void -
Writes the code to declare the given
typeParameter
. -
writeTypeParameter2(
TypeParameterElement2 typeParameter, {ExecutableElement2? methodBeingCopied}) → void -
Writes the code to declare the given
typeParameter
. -
writeTypeParameters(
List< TypeParameterElement> typeParameters, {ExecutableElement? methodBeingCopied}) → void -
Writes the code to declare the given list of
typeParameters
. The enclosing angle brackets are automatically written. -
writeTypeParameters2(
List< TypeParameterElement2> typeParameters, {ExecutableElement2? methodBeingCopied}) → void -
Writes the code to declare the given list of
typeParameters
. The enclosing angle brackets are automatically written. -
writeTypes(
Iterable< DartType> ? types, {String? prefix}) → void -
Writes the code for a comma-separated list of
types
, optionally prefixed by aprefix
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited