CorrectionUtils class final

Constructors

CorrectionUtils(ParsedUnitResult result)
CorrectionUtils.fromUnitAndContent(CompilationUnit unit, String content)

Properties

endOfLine → String
The EOL sequence to use for this CompilationUnit.
no setter
hashCode → int
The hash code for this object.
no setterinherited
oneIndent → String
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
twoIndents → String
no setter

Methods

findNode(int offset) → AstNode?
Returns the AstNode that encloses the given offset.
getLineContentEnd(int index) → int
Skips whitespace characters and single EOL on the right from index.
getLineContentStart(int index) → int
Skips spaces and tabs on the left from index.
getLineNext(int index) → int
Returns the index of the start of the line following the line which contains the given index.
getLinePrefix(int index) → String
Returns the whitespace prefix of the line which contains given index.
getLinesRange(SourceRange sourceRange, {bool skipLeadingEmptyLines = false}) → SourceRange
Returns a SourceRange that covers sourceRange and extends (if possible) to cover whole lines.
getLinesRangeStatements(List<Statement> statements) → SourceRange
Returns a SourceRange that covers all the given Statements.
getLineThis(int index) → int
Returns the start index of the line which contains the given index.
getNodePrefix(AstNode node) → String
Returns the whitespace prefix of the line which contains given node.
getNodeText(AstNode node, {bool withLeadingComments = false}) → String
Returns the text of the given AstNode in the unit, including preceding comments.
getPrefix(int endIndex) → String
Returns the whitespace prefix to the left of the given endIndex.
getRangeText(SourceRange range) → String
Returns the text of the given range in the unit.
getText(int offset, int length) → String
Returns the text of the given range in the unit.
indentSourceLeftRight(String source, {bool indentLeft = true}) → String
Indents the given source left or right.
invertCondition(Expression expression) → String
Returns the source of the inverted condition for the given logical expression.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
replaceSourceIndent(String source, String oldIndent, String newIndent, {bool includeLeading = false, bool ensureTrailingNewline = false}) → String
Returns the source with indentation changed from oldIndent to newIndent, keeping indentation of lines relative to each other.
replaceSourceRangeIndent(SourceRange range, String oldIndent, String newIndent, {bool includeLeading = false, bool ensureTrailingNewline = false}) → String
Returns the source of the given SourceRange with indentation changed from oldIndent to newIndent, keeping indentation of lines relative to each other.
toString() → String
A string representation of this object.
inherited

Operators

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