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. ThebuildLinkedEditfunction 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 akindand a list ofsuggestionsare provided, they will be added as suggestions to the group with the given kind.inherited -
canWriteType(
DartType? type, {ExecutableElement? methodBeingCopied, List< TypeParameterElement> ? typeParametersInScope}) → bool -
Checks whether the code for a type annotation for the given
typecan 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
stringto 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, ExecutableElement? methodBeingCopied, List< TypeParameterElement> ? typeParametersInScope, String? nameGroupName, DartType? type, String? typeGroupName, bool isRequiredType}) → void -
Writes the code for a single parameter with the given
name. -
writeFormalParameters(
Iterable< FormalParameterElement> parameters, {ExecutableElement? methodBeingCopied, List<TypeParameterElement> ? typeParametersInScope, String? groupNamePrefix, bool fillParameterNames = true, bool includeDefaultValues = true, bool requiredTypes}) → void -
Writes the code for a list of
parameters, including the surrounding parentheses and default values (unlessincludeDefaultValuesisfalse). -
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
stringto 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. -
writeParameter(
String name, {bool isCovariant, bool isRequiredNamed, ExecutableElement? methodBeingCopied, List< TypeParameterElement> ? typeParametersInScope, 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, {ExecutableElement? methodBeingCopied, List<TypeParameterElement> ? typeParametersInScope}) → void -
Writes the code for a parameter that would match the given
argument. -
writeParametersMatchingArguments(
ArgumentList arguments, {ExecutableElement? methodBeingCopied, List< TypeParameterElement> ? typeParametersInScope}) → 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. -
writeSetterDeclaration(
String name, {void bodyWriter()?, bool isStatic = false, String? nameGroupName, DartType? parameterType, String? parameterTypeGroupName, ExecutableElement? methodBeingCopied, List< TypeParameterElement> ? typeParametersInScope}) → void -
Writes the code for a declaration of a setter with the given
name. -
writeType(
DartType? type, {bool addSupertypeProposals = false, String? groupName, ExecutableElement? methodBeingCopied, List< TypeParameterElement> ? typeParametersInScope, bool required = false, bool shouldWriteDynamic = false}) → bool -
Writes the code for a type annotation for the given
type. -
writeTypeParameter(
TypeParameterElement typeParameter, {ExecutableElement? methodBeingCopied, List< TypeParameterElement> ? typeParametersInScope}) → void -
Writes the code to declare the given
typeParameter. -
writeTypeParameters(
List< TypeParameterElement> typeParameters, {ExecutableElement? methodBeingCopied, List<TypeParameterElement> ? typeParametersInScope}) → void -
Writes the code to declare the given list of
typeParameters. The enclosing angle brackets are automatically written. -
writeTypes(
Iterable< DartType> ? types, {String? prefix, bool shouldWriteDynamic = false}) → void -
Writes the code for a comma-separated list of
types, optionally prefixed by aprefix.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited