NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #19 most downloaded on pub.dev
Provides a standard representation for source code locations and spans.
Last release 8 months ago
05 Feb 2026
Release timing varies
gaps range from 2 weeks to 1.7 years
Nearly every release is documented
notes for 35 of 35 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
40 releases · first in 2014
Speedup of the SourceFile.fromString constructor.
SourceFile.fromString constructor.Move to dart-lang/tools monorepo.
dart-lang/tools monorepo.One column per quarter.
Add a SourceFile.codeUnits property.
SourceFile.codeUnits property.example/.Properly handle multi-line labels for multi-span highlights.
Properly handle multi-line labels for multi-span highlights.
Populate the pubspec repository field.
Add SourceSpanWithContextExtension.subspan that returns a SourceSpanWithContext rather than a plain SourceSpan.
SourceSpanWithContextExtension.subspan that returns a
SourceSpanWithContext rather than a plain SourceSpan.Fix a bug where highlighting multiple spans with null URLs could cause an assertion error. Now when multiple spans are passed with null URLs, they're
null URLs could cause an
assertion error. Now when multiple spans are passed with null URLs, they're
highlighted as though they all come from different source files.Fix a bug where the URL header for the highlights with multiple files would get omitted only one span has a non-null URI.
Stable release for null safety.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Add a SourceSpan.subspan() extension method which returns a slice of an existing source span.
SourceSpan.subspan() extension method which returns a slice of an
existing source span.Added toJson method to Pubspec to serialize the object back to a Map .
toJson method to Pubspec to serialize the object back to a Map.HostedDetails.url as a non-git URI.SourceSpan.highlightMultiple() and SourceSpan.messageMultiple() (both
extension methods), MultiSourceSpanException, and
MultiSourceSpanFormatException.Fix a bug where FileSpan.highlight() would crash for spans that covered a trailing newline and a single additional empty line.
FileSpan.highlight() would crash for spans that covered a
trailing newline and a single additional empty line.FileSpan.highlight() now properly highlights point spans at the beginning of lines.
FileSpan.highlight() now properly highlights point spans at the beginning of
lines.Fix Pool.forEach to ensure all workers complete before the stream is closed, even on error or cancellation.
Pool.forEach to ensure all workers complete before the stream is closed, even on error or cancellation.PoolResource.allowRelease callback throws.FileSpan.highlight() would put the highlight
indicator in the wrong position when highlighting a point span after the end
of a file.SourceFile.span() now goes to the end of the file by default, rather than ending one character before the end of the file. This matches the documented
SourceFile.span() now goes to the end of the file by default, rather than
ending one character before the end of the file. This matches the documented
behavior.
FileSpan.context now includes the full line on which the span appears for
empty spans at the beginning and end of lines.
Fix an edge case where FileSpan.highlight() could crash when highlighting a
span that ended with an empty line.
Produce better source span highlights for multi-line spans that cover the entire last line of the span, including the newline.
Produce better source span highlights for multi-line spans that cover the entire last line of the span, including the newline.
Produce better source span highlights for spans that contain Windows-style newlines.
Improve the output of SourceSpan.highlight() and SourceSpan.message():
Improve the output of SourceSpan.highlight() and SourceSpan.message():
term_glyph.ascii).Set max SDK version to <3.0.0, and adjust other dependencies.
<3.0.0, and adjust other dependencies.The new SourceFile() constructor is deprecated. This constructed a source file from a string's runes, rather than its code units, which runs counter t…
The new SourceFile() constructor is deprecated. This constructed a source
file from a string's runes, rather than its code units, which runs counter to
the way Dart handles strings otherwise. The new StringFile.fromString()
constructor (see below) should be used instead.
The new SourceFile.fromString() constructor was added. This works like new SourceFile(), except it uses code units rather than runes.
The current behavior when characters larger than 0xFFFF are passed to new SourceFile.decoded() is now considered deprecated.
Properly highlight spans for lines that include tabs with SourceSpan.highlight() and SourceSpan.message().
SourceSpan.highlight() and SourceSpan.message().Add SourceSpan.highlight(), which returns just the highlighted text that would be included in SourceSpan.message().
SourceSpan.highlight(), which returns just the highlighted text that
would be included in SourceSpan.message().* Fix a new strong mode error.
Fix a bug where a point span at the end of a file without a trailing newline would be printed incorrectly.
Allow SourceSpanException.message, SourceSpanFormatException.source, and SourceSpanWithContext.context to be overridden in strong mode.
SourceSpanException.message, SourceSpanFormatException.source, and
SourceSpanWithContext.context to be overridden in strong mode.Fix the declared type of FileSpan.start and FileSpan.end. In 1.2.0 these were mistakenly changed from FileLocation to SourceLocation.
FileSpan.start and FileSpan.end. In 1.2.0 these
were mistakenly changed from FileLocation to SourceLocation.Deprecated: Extending SourceLocation directly is deprecated. Instead, extend the new SourceLocationBase class or mix in the new SourceLocationMixin mi…
Deprecated: Extending SourceLocation directly is deprecated. Instead,
extend the new SourceLocationBase class or mix in the new
SourceLocationMixin mixin.
Dramatically improve the performance of FileLocation.
Optimize getLine() in SourceFile when repeatedly called.
getLine() in SourceFile when repeatedly called.Fixed another case in which FileSpan.union could throw an exception for external implementations of FileSpan.
FileSpan.union could throw an exception for
external implementations of FileSpan.Eliminated dart2js warning about overriding ==, but not hashCode.
==, but not hashCode.FileSpan.compareTo, FileSpan.==, FileSpan.union, and FileSpan.expand no longer throw exceptions for external implementations of FileSpan.
FileSpan.compareTo, FileSpan.==, FileSpan.union, and FileSpan.expand
no longer throw exceptions for external implementations of FileSpan.
FileSpan.hashCode now fully agrees with FileSpan.==.
Fixed validation in SourceSpanWithContext to allow multiple occurrences of text within context.
SourceSpanWithContext to allow multiple occurrences of
text within context.Fixed FileSpan's context to include the full span text, not just the first line of it.
FileSpan's context to include the full span text, not just the first
line of it.Add a deepCopyLinks argument to copyPath and copyPathSync .
deepCopyLinks argument to copyPath and copyPathSync.@visibleForTesting annotation from SharedStdIn.SharedStdIn.new.
AnsiCode and AnsiCodeType marked final. ThesefinalexpectApiSummaryClean, ApiSummaryFormat, andApiSummaryVerificationException to support one-liner golden file verificationdart test (e.g. test('api_summary', expectApiSummaryClean);).--write (-w), --check (-c), and --output (-o) flags to theapi_summary CLI executable.SourceSpanWithContext: a span that also includes the full line of text
that contains the span.Cleanup equality operator to accept any Object rather than just a SourceLocation.
SourceLocation.Avoid unintentionally allocating extra objects for internal FileSpan operations.
Avoid unintentionally allocating extra objects for internal FileSpan
operations.
Ensure that SourceSpan.operator== works on arbitrary Objects.
Initial stable release.
This package was extracted from the
source_maps package, but the
API has many differences. Among them:
Span has been renamed to SourceSpan and Location has been renamed to
SourceLocation to clarify their purpose and maintain consistency with the
package name. Likewise, SpanException is now SourceSpanException and
SpanFormatException is not SourceSpanFormatException.
FixedSpan and FixedLocation have been rolled into the Span and
Location classes, respectively.
SourceFile is 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, and SourceFile.url now
return Uri objects rather than Strings. The constructors allow either
Strings or Uris.
Span.getLocationMessage and SourceFile.getLocationMessage are now
SourceSpan.message and SourceFile.message, respectively. Rather than
taking both a useColor and a color parameter, they now take a single
color parameter that controls both whether and which color is used.
Span.isIdentifier has been removed. This property doesn't make sense outside
of a source map context.
SourceFileSegment has been removed. This class wasn't widely used and was
inconsistent in its choice of which parameters were considered relative and
which absolute.
Your coding agent can read these notes before it upgrades. Set up the MCP server →