RangeFactory class

A factory used to create instances of SourceRange based on various syntactic and semantic entities.

Constructors

RangeFactory()

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

argumentRange(ArgumentList argumentList, int lower, int upper, bool forDeletion) → SourceRange
Return a source range that covers all of the arguments in the argumentList between the lower and upper indices, inclusive. The flag forDeletion controls whether a comma between the given indices and the neighboring arguments should be included in the range. If the flag is true, then the range can be deleted to delete the covered arguments and leave a valid argument list. If the flag is false, then the range can be replaced with different argument values.
deletionRange(AstNode node) → SourceRange
Return the deletion range of the node, considering the spaces and comments before and after it.
elementName(Element element) → SourceRange
Return a source range that covers the name of the given element.
endEnd(SyntacticEntity leftEntity, SyntacticEntity rightEntity) → SourceRange
Return a source range that starts at the end of leftEntity and ends at the end of rightEntity.
endLength(SyntacticEntity entity, int length) → SourceRange
Return a source range that starts at the end of entity and has the given length.
endStart(SyntacticEntity leftEntity, SyntacticEntity rightEntity) → SourceRange
Return a source range that starts at the end of leftEntity and ends at the start of rightEntity.
entity(SyntacticEntity node) → SourceRange
Return a source range that covers the same range as the given node.
error(AnalysisError error) → SourceRange
Return a source range that covers the same range as the given error.
node(AstNode node) → SourceRange
Return a source range that covers the same range as the given node.
nodeInList<T extends AstNode>(NodeList<T> list, T item) → SourceRange
Return a source range that covers the given item (including a leading or trailing comma as appropriate) in the containing list.
nodes(List<AstNode> nodes) → SourceRange
Return a source range that covers all of the given nodes (that is, from the start of the first node to the end of the last node.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
offsetBy(SourceRange range, int offset) → SourceRange
Return a source range whose length is the same as the given range, but whose offset is the offset of the given range with offset added to it.
startEnd(SyntacticEntity leftEntity, SyntacticEntity rightEntity) → SourceRange
Return a source range that starts at the start of leftEntity and ends at the end of rightEntity.
startLength(SyntacticEntity entity, int length) → SourceRange
Return a source range that starts at the start of entity and has a length of length.
startOffsetEndOffset(int startOffset, int endOffset) → SourceRange
Return a source range that starts at the given startOffset and ends at the given endOffset.
startOffsetLength(int startOffset, int length) → SourceRange
Return a source range that starts at the given startOffset, and has the given length.
startStart(SyntacticEntity leftEntity, SyntacticEntity rightEntity) → SourceRange
Return a source range that starts at the start of leftEntity and ends at the start of rightEntity.
token(Token token) → SourceRange
Return a source range that covers the same range as the given token.
toString() String
A string representation of this object.
inherited

Operators

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