source_span 1.3.0
source_span: ^1.3.0 copied to clipboard
A library for identifying source spans and locations.
1.3.0 #
- Add
SourceSpan.highlight(), which returns just the highlighted text that would be included inSourceSpan.message().
1.2.4 #
- Fix a new strong mode error.
1.2.3 #
- Fix a bug where a point span at the end of a file without a trailing newline would be printed incorrectly.
1.2.2 #
- Allow
SourceSpanException.message,SourceSpanFormatException.source, andSourceSpanWithContext.contextto be overridden in strong mode.
1.2.1 #
- Fix the declared type of
FileSpan.startandFileSpan.end. In 1.2.0 these were mistakenly changed fromFileLocationtoSourceLocation.
1.2.0 #
-
Deprecated: Extending
SourceLocationdirectly is deprecated. Instead, extend the newSourceLocationBaseclass or mix in the newSourceLocationMixinmixin. -
Dramatically improve the performance of
FileLocation.
1.1.6 #
- Optimize
getLine()inSourceFilewhen repeatedly called.
1.1.5 #
- Fixed another case in which
FileSpan.unioncould throw an exception for external implementations ofFileSpan.
1.1.4 #
- Eliminated dart2js warning about overriding
==, but nothashCode.
1.1.3 #
-
FileSpan.compareTo,FileSpan.==,FileSpan.union, andFileSpan.expandno longer throw exceptions for external implementations ofFileSpan. -
FileSpan.hashCodenow fully agrees withFileSpan.==.
1.1.2 #
- Fixed validation in
SourceSpanWithContextto allow multiple occurrences oftextwithincontext.
1.1.1 #
- Fixed
FileSpan's context to include the full span text, not just the first line of it.
1.1.0 #
- Added
SourceSpanWithContext: a span that also includes the full line of text that contains the span.
1.0.3 #
- Cleanup equality operator to accept any Object rather than just a
SourceLocation.
1.0.2 #
-
Avoid unintentionally allocating extra objects for internal
FileSpanoperations. -
Ensure that
SourceSpan.operator==works on arbitraryObjects.
1.0.1 #
- Use a more compact internal representation for
FileSpan.
1.0.0 #
This package was extracted from the
source_maps package, but the
API has many differences. Among them:
-
Spanhas been renamed toSourceSpanandLocationhas been renamed toSourceLocationto clarify their purpose and maintain consistency with the package name. Likewise,SpanExceptionis nowSourceSpanExceptionandSpanFormatExceptionis notSourceSpanFormatException. -
FixedSpanandFixedLocationhave been rolled into theSpanandLocationclasses, respectively. -
SourceFileis more aggressive about validating its arguments. Out-of-bounds lines, columns, and offsets will now throw errors rather than be silently clamped. -
SourceSpan.sourceUrl,SourceLocation.sourceUrl, andSourceFile.urlnow returnUriobjects rather thanStrings. The constructors allow eitherStrings orUris. -
Span.getLocationMessageandSourceFile.getLocationMessageare nowSourceSpan.messageandSourceFile.message, respectively. Rather than taking both auseColorand acolorparameter, they now take a singlecolorparameter that controls both whether and which color is used. -
Span.isIdentifierhas been removed. This property doesn't make sense outside of a source map context. -
SourceFileSegmenthas been removed. This class wasn't widely used and was inconsistent in its choice of which parameters were considered relative and which absolute.