CorrectionUtils class
final
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, {})
→ 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