@@ -190,7 +190,7 @@ class Snapshot {
190
190
File _snapshotFile;
191
191
192
192
File get snapshotFile => _snapshotFile;
193
- final Completer _snapshotCompleter = Completer ();
193
+ final Completer < void > _snapshotCompleter = Completer ();
194
194
195
195
Snapshot (Directory snapshotCache, String toolPath, int serial) {
196
196
if (toolPath.endsWith ('.snapshot' )) {
@@ -406,7 +406,7 @@ class ToolConfiguration {
406
406
/// A container class to keep track of where our yaml data came from.
407
407
class _YamlFileData {
408
408
/// The map from the yaml file.
409
- final Map data;
409
+ final Map < Object , Object > data;
410
410
411
411
/// The path to the directory containing the yaml file.
412
412
final String canonicalDirectoryPath;
@@ -521,10 +521,10 @@ abstract class DartdocOption<T> {
521
521
522
522
bool get _isDouble => _kDoubleVal is T ;
523
523
524
- DartdocOption _parent;
524
+ DartdocOption < Object > _parent;
525
525
526
526
/// The parent of this DartdocOption, or null if this is the root.
527
- DartdocOption get parent => _parent;
527
+ DartdocOption < Object > get parent => _parent;
528
528
529
529
final Map <String , _YamlFileData > __yamlAtCanonicalPathCache = {};
530
530
@@ -549,10 +549,10 @@ abstract class DartdocOption<T> {
549
549
/// Throw [DartdocFileMissing] with a detailed error message indicating where
550
550
/// the error came from when a file or directory option is missing.
551
551
void _onMissing (
552
- _OptionValueWithContext valueWithContext, String missingFilename);
552
+ _OptionValueWithContext < Object > valueWithContext, String missingFilename);
553
553
554
554
/// Call [_onMissing] for every path that does not exist.
555
- void _validatePaths (_OptionValueWithContext valueWithContext) {
555
+ void _validatePaths (_OptionValueWithContext < dynamic > valueWithContext) {
556
556
if (! mustExist) return ;
557
557
assert (isDir || isFile);
558
558
List <String > resolvedPaths;
@@ -578,7 +578,7 @@ abstract class DartdocOption<T> {
578
578
579
579
/// For a [List<String>] or [String] value, if [isDir] or [isFile] is set,
580
580
/// resolve paths in value relative to canonicalPath.
581
- T _handlePathsInContext (_OptionValueWithContext valueWithContext) {
581
+ T _handlePathsInContext (_OptionValueWithContext < Object > valueWithContext) {
582
582
if (valueWithContext? .value == null || ! (isDir || isFile)) {
583
583
return valueWithContext? .value;
584
584
}
@@ -594,15 +594,15 @@ abstract class DartdocOption<T> {
594
594
ArgResults get _argResults => root.__argResults;
595
595
596
596
/// Set the parent of this [DartdocOption] . Do not call more than once.
597
- set parent (DartdocOption newParent) {
597
+ set parent (DartdocOption < Object > newParent) {
598
598
assert (_parent == null );
599
599
_parent = newParent;
600
600
}
601
601
602
602
/// The root [DartdocOption] containing this object, or [this] if the object
603
603
/// has no parent.
604
- DartdocOption get root {
605
- DartdocOption p = this ;
604
+ DartdocOption < Object > get root {
605
+ DartdocOption < Object > p = this ;
606
606
while (p.parent != null ) {
607
607
p = p.parent;
608
608
}
@@ -612,7 +612,7 @@ abstract class DartdocOption<T> {
612
612
/// All object names starting at the root.
613
613
Iterable <String > get keys {
614
614
var keyList = < String > [];
615
- DartdocOption option = this ;
615
+ DartdocOption < Object > option = this ;
616
616
while (option? .name != null ) {
617
617
keyList.add (option.name);
618
618
option = option.parent;
@@ -621,7 +621,7 @@ abstract class DartdocOption<T> {
621
621
}
622
622
623
623
/// Direct children of this node, mapped by name.
624
- final Map <String , DartdocOption > _children = {};
624
+ final Map <String , DartdocOption < Object > > _children = {};
625
625
626
626
/// Return the calculated value of this option, given the directory as context.
627
627
///
@@ -643,7 +643,7 @@ abstract class DartdocOption<T> {
643
643
valueAt (Directory (p.canonicalize (p.basename (element.source.fullName))));
644
644
645
645
/// Adds a DartdocOption to the children of this DartdocOption.
646
- void add (DartdocOption option) {
646
+ void add (DartdocOption < Object > option) {
647
647
if (_children.containsKey (option.name)) {
648
648
throw DartdocOptionError (
649
649
'Tried to add two children with the same name: ${option .name }' );
@@ -657,16 +657,16 @@ abstract class DartdocOption<T> {
657
657
void _onAdd () {}
658
658
659
659
/// Adds a list of dartdoc options to the children of this DartdocOption.
660
- void addAll (Iterable <DartdocOption > options) =>
660
+ void addAll (Iterable <DartdocOption < Object > > options) =>
661
661
options.forEach ((o) => add (o));
662
662
663
663
/// Get the immediate child of this node named [name] .
664
- DartdocOption operator [](String name) {
664
+ DartdocOption < dynamic > operator [](String name) {
665
665
return _children[name];
666
666
}
667
667
668
668
/// Apply the function [visit] to [this] and all children.
669
- void traverse (void Function (DartdocOption option) visit) {
669
+ void traverse (void Function (DartdocOption < Object > option) visit) {
670
670
visit (this );
671
671
_children.values.forEach ((d) => d.traverse (visit));
672
672
}
@@ -702,7 +702,7 @@ class DartdocOptionFileSynth<T> extends DartdocOption<T>
702
702
703
703
@override
704
704
void _onMissing (
705
- _OptionValueWithContext valueWithContext, String missingPath) {
705
+ _OptionValueWithContext < Object > valueWithContext, String missingPath) {
706
706
if (valueWithContext.definingFile != null ) {
707
707
_onMissingFromFiles (valueWithContext, missingPath);
708
708
} else {
@@ -744,7 +744,7 @@ class DartdocOptionArgSynth<T> extends DartdocOption<T>
744
744
745
745
@override
746
746
void _onMissing (
747
- _OptionValueWithContext valueWithContext, String missingPath) {
747
+ _OptionValueWithContext < Object > valueWithContext, String missingPath) {
748
748
_onMissingFromArgs (valueWithContext, missingPath);
749
749
}
750
750
@@ -794,25 +794,24 @@ abstract class DartdocSyntheticOption<T> implements DartdocOption<T> {
794
794
T valueAt (Directory dir) => _valueAtFromSynthetic (dir);
795
795
796
796
T _valueAtFromSynthetic (Directory dir) {
797
- _OptionValueWithContext context =
798
- _OptionValueWithContext <T >(_compute (this , dir), dir.path);
797
+ var context = _OptionValueWithContext <T >(_compute (this , dir), dir.path);
799
798
return _handlePathsInContext (context);
800
799
}
801
800
802
801
@override
803
- void _onMissing (
804
- _OptionValueWithContext valueWithContext, String missingPath) =>
802
+ void _onMissing (_OptionValueWithContext < Object > valueWithContext,
803
+ String missingPath) =>
805
804
_onMissingFromSynthetic (valueWithContext, missingPath);
806
805
807
806
void _onMissingFromSynthetic (
808
- _OptionValueWithContext valueWithContext, String missingPath) {
807
+ _OptionValueWithContext < Object > valueWithContext, String missingPath) {
809
808
var description = 'Synthetic configuration option ${name } from <internal>' ;
810
809
throw DartdocFileMissing (
811
810
'$description , computed as ${valueWithContext .value }, resolves to missing path: "${missingPath }"' );
812
811
}
813
812
}
814
813
815
- typedef OptionGenerator = Future <List <DartdocOption >> Function ();
814
+ typedef OptionGenerator = Future <List <DartdocOption < Object > >> Function ();
816
815
817
816
/// A [DartdocOption] that only contains other [DartdocOption] s and is not an option itself.
818
817
class DartdocOptionSet extends DartdocOption <Null > {
@@ -840,12 +839,12 @@ class DartdocOptionSet extends DartdocOption<Null> {
840
839
841
840
/// Since we have no value, [_onMissing] does nothing.
842
841
@override
843
- void _onMissing (
844
- _OptionValueWithContext valueWithContext, String missingFilename) {}
842
+ void _onMissing (_OptionValueWithContext < Object > valueWithContext,
843
+ String missingFilename) {}
845
844
846
845
/// Traverse skips this node, because it doesn't represent a real configuration object.
847
846
@override
848
- void traverse (void Function (DartdocOption option) visitor) {
847
+ void traverse (void Function (DartdocOption < Object > option) visitor) {
849
848
_children.values.forEach ((d) => d.traverse (visitor));
850
849
}
851
850
}
@@ -917,7 +916,7 @@ class DartdocOptionArgFile<T> extends DartdocOption<T>
917
916
918
917
@override
919
918
void _onMissing (
920
- _OptionValueWithContext valueWithContext, String missingPath) {
919
+ _OptionValueWithContext < Object > valueWithContext, String missingPath) {
921
920
if (valueWithContext.definingFile != null ) {
922
921
_onMissingFromFiles (valueWithContext, missingPath);
923
922
} else {
@@ -988,12 +987,12 @@ abstract class _DartdocFileOption<T> implements DartdocOption<T> {
988
987
String get fieldName => keys.join ('.' );
989
988
990
989
@override
991
- void _onMissing (
992
- _OptionValueWithContext valueWithContext, String missingPath) =>
990
+ void _onMissing (_OptionValueWithContext < Object > valueWithContext,
991
+ String missingPath) =>
993
992
_onMissingFromFiles (valueWithContext, missingPath);
994
993
995
994
void _onMissingFromFiles (
996
- _OptionValueWithContext valueWithContext, String missingPath) {
995
+ _OptionValueWithContext < Object > valueWithContext, String missingPath) {
997
996
var dartdocYaml = p.join (
998
997
valueWithContext.canonicalDirectoryPath, valueWithContext.definingFile);
999
998
throw DartdocFileMissing (
@@ -1015,7 +1014,7 @@ abstract class _DartdocFileOption<T> implements DartdocOption<T> {
1015
1014
T _valueAtFromFiles (Directory dir) {
1016
1015
var key = p.canonicalize (dir.path);
1017
1016
if (! __valueAtFromFiles.containsKey (key)) {
1018
- _OptionValueWithContext valueWithContext;
1017
+ _OptionValueWithContext < Object > valueWithContext;
1019
1018
if (parentDirOverridesChild) {
1020
1019
valueWithContext = _valueAtFromFilesLastFound (dir);
1021
1020
} else {
@@ -1029,8 +1028,8 @@ abstract class _DartdocFileOption<T> implements DartdocOption<T> {
1029
1028
/// Searches all dartdoc_options files through parent directories,
1030
1029
/// starting at [dir] , for the option and returns one once
1031
1030
/// found.
1032
- _OptionValueWithContext _valueAtFromFilesFirstFound (Directory dir) {
1033
- _OptionValueWithContext value;
1031
+ _OptionValueWithContext < Object > _valueAtFromFilesFirstFound (Directory dir) {
1032
+ _OptionValueWithContext < Object > value;
1034
1033
while (true ) {
1035
1034
value = _valueAtFromFile (dir);
1036
1035
if (value != null || p.equals (dir.parent.path, dir.path)) break ;
@@ -1042,8 +1041,8 @@ abstract class _DartdocFileOption<T> implements DartdocOption<T> {
1042
1041
/// Searches all dartdoc_options files for the option, and returns the
1043
1042
/// value in the top-most parent directory dartdoc_options.yaml file it is
1044
1043
/// mentioned in.
1045
- _OptionValueWithContext _valueAtFromFilesLastFound (Directory dir) {
1046
- _OptionValueWithContext value;
1044
+ _OptionValueWithContext < Object > _valueAtFromFilesLastFound (Directory dir) {
1045
+ _OptionValueWithContext < Object > value;
1047
1046
while (true ) {
1048
1047
var tmpValue = _valueAtFromFile (dir);
1049
1048
if (tmpValue != null ) value = tmpValue;
@@ -1055,7 +1054,7 @@ abstract class _DartdocFileOption<T> implements DartdocOption<T> {
1055
1054
1056
1055
/// Returns null if not set in the yaml file in this directory (or its
1057
1056
/// parents).
1058
- _OptionValueWithContext _valueAtFromFile (Directory dir) {
1057
+ _OptionValueWithContext < Object > _valueAtFromFile (Directory dir) {
1059
1058
var yamlFileData = _yamlAtDirectory (dir);
1060
1059
var contextPath = yamlFileData.canonicalDirectoryPath;
1061
1060
dynamic yamlData = yamlFileData.data;
@@ -1177,12 +1176,12 @@ abstract class _DartdocArgOption<T> implements DartdocOption<T> {
1177
1176
}
1178
1177
1179
1178
@override
1180
- void _onMissing (
1181
- _OptionValueWithContext valueWithContext, String missingPath) =>
1179
+ void _onMissing (_OptionValueWithContext < Object > valueWithContext,
1180
+ String missingPath) =>
1182
1181
_onMissingFromArgs (valueWithContext, missingPath);
1183
1182
1184
1183
void _onMissingFromArgs (
1185
- _OptionValueWithContext valueWithContext, String missingPath) {
1184
+ _OptionValueWithContext < Object > valueWithContext, String missingPath) {
1186
1185
throw DartdocFileMissing (
1187
1186
'Argument --${argName }, set to ${valueWithContext .value }, resolves to missing path: "${missingPath }"' );
1188
1187
}
@@ -1191,7 +1190,7 @@ abstract class _DartdocArgOption<T> implements DartdocOption<T> {
1191
1190
/// the [argParser] and the working directory from [directoryCurrent] .
1192
1191
///
1193
1192
/// Throws [UnsupportedError] if [T] is not a supported type.
1194
- _OptionValueWithContext _valueAtFromArgsWithContext () {
1193
+ _OptionValueWithContext < Object > _valueAtFromArgsWithContext () {
1195
1194
if (! _argResults.wasParsed (argName)) return null ;
1196
1195
1197
1196
T retval;
@@ -1429,10 +1428,10 @@ class DartdocOptionContext extends DartdocOptionContextBase
1429
1428
1430
1429
/// Instantiate dartdoc's configuration file and options parser with the
1431
1430
/// given command line arguments.
1432
- Future <List <DartdocOption >> createDartdocOptions (
1431
+ Future <List <DartdocOption < Object > >> createDartdocOptions (
1433
1432
PackageMetaProvider packageMetaProvider,
1434
1433
) async {
1435
- return < DartdocOption > [
1434
+ return [
1436
1435
DartdocOptionArgOnly <bool >('allowTools' , false ,
1437
1436
help: 'Execute user-defined tools to fill in @tool directives.' ,
1438
1437
negatable: true ),
0 commit comments