source_span icon indicating copy to clipboard operation
source_span copied to clipboard

A library for identifying source spans and locations.

Results 11 source_span issues
Sort by recently updated
recently updated
newest added
trafficstars

version: 1.8.2 (latest) ```dart SourceFile.fromString('abc\r\n\r\ndef').span(2, 6).highlight() Invalid argument(s): The context line "abc " must contain "c ". #0 new SourceSpanWithContext (package:source_span/src/span_with_context.dart:28:7) #1 _Highlight._normalizeNewlines (package:source_span/src/highlighter.dart:567:12) #2 new _Highlight. (package:source_span/src/highlighter.dart:528:21) #3 new...

type-bug

This looks like it may be useful, but I don't understand what it's for. From what I read, it can help provide more information for using is logging and errors,...

contributions-welcome
type-documentation

This causes code-size warnings when compiling to js: > Hint: Using '.runtimeType.toString()' causes the compiler to generate more code because it needs to preserve type arguments on generic classes, even...

type-enhancement
contributions-welcome

The pub site can show example code for a package. https://www.dartlang.org/tools/pub/package-layout#examples Let me know if you want me to try working on this. related issue : dart-lang/site-www#413

type-enhancement
contributions-welcome

I tested that with the error reporting of dart-sass, which relies on that package (using `SourceFile.fromString`). Giving it this invalid input, it reports an error on the `;`: ```scss a...

contributions-welcome

Adding a static type makes the API easier to use correctly. The call site can easily inline the `Uri.parse` if necessary.

next-breaking-release

https://github.com/dart-lang/source_span/pull/49 adds some extension methods on `SourceSpan`. These are being added as extensions to avoid breaking downstream classes that implement `SourceSpan` without including `SourceSpanMixin`, but they would ideally be instance...

next-breaking-release

I am stress-testing my parser and `SourceFile.getText` seems to be making unnecessary allocations. Isn't `String.fromCharCodes(_decodedChars, start, end);` a valid substitute? It appears to cause much less allocations this way. https://github.com/dart-lang/source_span/blob/f9343087ba37f0cb089648b75fc30d99d2eb2c26/lib/src/file.dart#L216-L217

type-enhancement
contributions-welcome

The body of the `SourceFile.decoded` could be executed lazily. It would increase the performance for cases when serialisation of spans is not necessary. For example, doing successful AST transformations without...

type-enhancement
contributions-welcome

Currently `SourceSpan`s are required to have text associated with them. However, this isn't always possible; for example, spans extracted from source maps won't necessarily have the text of the source...

type-enhancement