Skip to content

Commit 9f3133a

Browse files
committed
Fix dartdoc errors
Also fix a couple places where our external API wasn't quite right.
1 parent a28c656 commit 9f3133a

File tree

15 files changed

+42
-21
lines changed

15 files changed

+42
-21
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
## 1.36.1
1+
## 1.37.0
22

33
### Dart API
44

5+
* **Potentially breaking bug fix:** `SassNumber.asSlash`,
6+
`SassNumber.withSlash()`, and `SassNumber.withoutSlash()` have been marked as
7+
`@internal`. They were never intended to be used outside the `sass` package.
8+
59
* **Potentially breaking bug fix:** `SassException` has been marked as `@sealed`
610
to formally indicate that it's not intended to be extended outside of the
711
`sass` package.
812

13+
* Add a `Value.withListContents()` method that returns a new Sass list with the
14+
same list separator and brackets as the current value, interpreted as a list.
15+
916
## 1.36.0
1017

1118
### Dart API

lib/sass.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ export 'src/warn.dart' show warn;
7676
/// correspond to which in the resulting CSS. [SingleMapping.targetUrl] will be
7777
/// `null`. It's up to the caller to save this mapping to disk and add a source
7878
/// map comment to [CompileResult.css] pointing to it. Users using the
79-
/// [SourceMap] API should be sure to add the [`source_maps`][] package to their
80-
/// pubspec.
79+
/// [SingleMapping] API should be sure to add the [`source_maps`][] package to
80+
/// their pubspec.
8181
///
8282
/// [`source_maps`]: https://pub.dartlang.org/packages/source_maps
8383
///
@@ -168,8 +168,8 @@ CompileResult compileToResult(String path,
168168
/// correspond to which in the resulting CSS. [SingleMapping.targetUrl] will be
169169
/// `null`. It's up to the caller to save this mapping to disk and add a source
170170
/// map comment to [CompileResult.css] pointing to it. Users using the
171-
/// [SourceMap] API should be sure to add the [`source_maps`][] package to their
172-
/// pubspec.
171+
/// [SingleMapping] API should be sure to add the [`source_maps`][] package to
172+
/// their pubspec.
173173
///
174174
/// [`source_maps`]: https://pub.dartlang.org/packages/source_maps
175175
///
@@ -290,7 +290,7 @@ Future<CompileResult> compileStringToResultAsync(String source,
290290
/// sections of the source file(s) correspond to which in the resulting CSS.
291291
/// It's called immediately before this method returns, and only if compilation
292292
/// succeeds. Note that [SingleMapping.targetUrl] will always be `null`. Users
293-
/// using the [SourceMap] API should be sure to add the [`source_maps`][]
293+
/// using the [SingleMapping] API should be sure to add the [`source_maps`][]
294294
/// package to their pubspec.
295295
///
296296
/// [`source_maps`]: https://pub.dartlang.org/packages/source_maps
@@ -341,7 +341,7 @@ String compile(
341341
/// sections of the source file(s) correspond to which in the resulting CSS.
342342
/// It's called immediately before this method returns, and only if compilation
343343
/// succeeds. Note that [SingleMapping.targetUrl] will always be `null`. Users
344-
/// using the [SourceMap] API should be sure to add the [`source_maps`][]
344+
/// using the [SingleMapping] API should be sure to add the [`source_maps`][]
345345
/// package to their pubspec.
346346
///
347347
/// [`source_maps`]: https://pub.dartlang.org/packages/source_maps

lib/src/ast/sass/at_root_query.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import 'package:collection/collection.dart';
66

7+
import '../../exception.dart';
78
import '../../logger.dart';
89
import '../../parse/at_root_query.dart';
910
import '../css.dart';

lib/src/ast/sass/expression.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// MIT-style license that can be found in the LICENSE file or at
33
// https://opensource.org/licenses/MIT.
44

5+
import '../../exception.dart';
56
import '../../logger.dart';
67
import '../../parse/scss.dart';
78
import '../../visitor/interface/expression.dart';

lib/src/ast/sass/statement/stylesheet.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@ import 'dart:collection';
66

77
import 'package:source_span/source_span.dart';
88

9-
import '../../../visitor/interface/statement.dart';
9+
import '../../../exception.dart';
1010
import '../../../logger.dart';
1111
import '../../../parse/css.dart';
1212
import '../../../parse/sass.dart';
1313
import '../../../parse/scss.dart';
1414
import '../../../syntax.dart';
15+
import '../../../visitor/interface/statement.dart';
1516
import '../statement.dart';
16-
import 'parent.dart';
1717
import 'forward_rule.dart';
1818
import 'loud_comment.dart';
19+
import 'parent.dart';
1920
import 'silent_comment.dart';
2021
import 'use_rule.dart';
2122
import 'variable_declaration.dart';

lib/src/ast/sass/statement/use_rule.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import 'package:source_span/source_span.dart';
66

7+
import '../../../exception.dart';
78
import '../../../logger.dart';
89
import '../../../parse/scss.dart';
910
import '../../../visitor/interface/statement.dart';

lib/src/ast/sass/statement/variable_declaration.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import 'package:source_span/source_span.dart';
66

7+
import '../../../exception.dart';
78
import '../../../logger.dart';
89
import '../../../parse/scss.dart';
910
import '../../../utils.dart';

lib/src/callable.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import 'package:meta/meta.dart';
66

77
import 'callable/async.dart';
88
import 'callable/built_in.dart';
9+
import 'exception.dart';
910
import 'value.dart';
1011

1112
export 'callable/async.dart';
@@ -41,8 +42,8 @@ export 'callable/user_defined.dart';
4142
/// * When manipulating values like lists, strings, and numbers that have
4243
/// metadata (comma versus space separated, bracketed versus unbracketed,
4344
/// quoted versus unquoted, units), the output metadata should match the input
44-
/// metadata. For lists, the [Value.changeList] method can be used to do this
45-
/// automatically.
45+
/// metadata. For lists, the [Value.withListContents] method can be used to do
46+
/// this automatically.
4647
///
4748
/// * When in doubt, lists should default to comma-separated, strings should
4849
/// default to quoted, and number should default to unitless.

lib/src/callable/async.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import 'dart:async';
66

77
import 'package:meta/meta.dart';
88

9+
import '../exception.dart';
910
import '../value.dart';
1011
import 'async_built_in.dart';
1112

lib/src/functions/list.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ final _setNth = _function("set-nth", r"$list, $n, $value", (arguments) {
3838
var value = arguments[2];
3939
var newList = list.asList.toList();
4040
newList[list.sassIndexToListIndex(index, "n")] = value;
41-
return arguments[0].changeListContents(newList);
41+
return arguments[0].withListContents(newList);
4242
});
4343

4444
final _join = _function(
@@ -99,7 +99,7 @@ final _append =
9999
}
100100

101101
var newList = [...list.asList, value];
102-
return list.changeListContents(newList, separator: separator);
102+
return list.withListContents(newList, separator: separator);
103103
});
104104

105105
final _zip = _function("zip", r"$lists...", (arguments) {

lib/src/importer/package.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ class PackageImporter extends Importer {
2626
/// package.
2727
///
2828
/// [`PackageConfig`]: https://pub.dev/documentation/package_config/latest/package_config.package_config/PackageConfig-class.html
29-
PackageImporter(this._packageConfig);
29+
PackageImporter(PackageConfig packageConfig)
30+
: _packageConfig = packageConfig;
3031

3132
Uri? canonicalize(Uri url) {
3233
if (url.scheme == 'file') return _filesystemImporter.canonicalize(url);

lib/src/node/value/list.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final Function listConstructor = createClass('SassList',
3434
'setValue': (_NodeSassList thisArg, int index, Object value) {
3535
var mutable = thisArg.dartValue.asList.toList();
3636
mutable[index] = unwrapValue(value);
37-
thisArg.dartValue = thisArg.dartValue.changeListContents(mutable);
37+
thisArg.dartValue = thisArg.dartValue.withListContents(mutable);
3838
},
3939
'getSeparator': (_NodeSassList thisArg) =>
4040
thisArg.dartValue.separator == ListSeparator.comma,

lib/src/value.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,7 @@ abstract class Value {
307307

308308
/// Returns a new list containing [contents] that defaults to this value's
309309
/// separator and brackets.
310-
///
311-
/// @nodoc
312-
@internal
313-
SassList changeListContents(Iterable<Value> contents,
310+
SassList withListContents(Iterable<Value> contents,
314311
{ListSeparator? separator, bool? brackets}) {
315312
return SassList(contents, separator ?? this.separator,
316313
brackets: brackets ?? hasBrackets);

lib/src/value/number.dart

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ abstract class SassNumber extends Value {
196196

197197
/// The representation of this number as two slash-separated numbers, if it
198198
/// has one.
199+
///
200+
/// @nodoc
201+
@internal
199202
final Tuple2<SassNumber, SassNumber>? asSlash;
200203

201204
/// Whether [this] is an integer, according to [fuzzyEquals].
@@ -259,10 +262,16 @@ abstract class SassNumber extends Value {
259262
SassNumber withValue(num value);
260263

261264
/// Returns a copy of [this] without [asSlash] set.
265+
///
266+
/// @nodoc
267+
@internal
262268
SassNumber withoutSlash() => asSlash == null ? this : withValue(value);
263269

264-
/// Returns a copy of [this] with [this.asSlash] set to a tuple containing
270+
/// Returns a copy of [this] with [asSlash] set to a tuple containing
265271
/// [numerator] and [denominator].
272+
///
273+
/// @nodoc
274+
@internal
266275
SassNumber withSlash(SassNumber numerator, SassNumber denominator);
267276

268277
SassNumber assertNumber([String? name]) => this;

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: sass
2-
version: 1.36.0
2+
version: 1.37.0
33
description: A Sass implementation in Dart.
44
author: Sass Team
55
homepage: https://github.com/sass/dart-sass

0 commit comments

Comments
 (0)