File tree Expand file tree Collapse file tree 4 files changed +15
-2
lines changed Expand file tree Collapse file tree 4 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -7,12 +7,14 @@ library;
7
7
8
8
import 'dart:core' ;
9
9
10
+ import 'package:analyzer/dart/analysis/features.dart' ;
10
11
import 'package:analyzer/dart/element/element.dart' ;
11
12
import 'package:analyzer/dart/element/scope.dart' ;
12
13
import 'package:collection/collection.dart' ;
13
14
import 'package:dartdoc/src/model/library.dart' ;
14
15
import 'package:dartdoc/src/model/model_element.dart' ;
15
16
import 'package:dartdoc/src/model/nameable.dart' ;
17
+ import 'package:dartdoc/src/model/prefix.dart' ;
16
18
import 'package:meta/meta.dart' ;
17
19
18
20
class _ReferenceChildrenLookup {
@@ -55,6 +57,12 @@ mixin CommentReferable implements Nameable {
55
57
// First attempt: Ask analyzer's `Scope.lookup` API.
56
58
var result = _lookupViaScope (referenceLookup, filter: filter);
57
59
if (result != null ) {
60
+ if (result is Prefix &&
61
+ result.name == '_' &&
62
+ library! .element.featureSet.isEnabled (Feature .wildcard_variables)) {
63
+ // A wildcard import prefix is non-binding.
64
+ continue ;
65
+ }
58
66
return result;
59
67
}
60
68
Original file line number Diff line number Diff line change 2
2
// for details. All rights reserved. Use of this source code is governed by a
3
3
// BSD-style license that can be found in the LICENSE file.
4
4
5
+ import 'package:analyzer/dart/analysis/features.dart' ;
5
6
import 'package:analyzer/dart/element/element.dart' ;
6
7
import 'package:analyzer/dart/element/scope.dart' ;
7
8
import 'package:analyzer/source/line_info.dart' ;
@@ -442,6 +443,11 @@ class Library extends ModelElement
442
443
// ambiguous. dart-lang/dartdoc#2683.
443
444
for (var MapEntry (key: prefix, value: libraries)
444
445
in _prefixToLibrary.entries) {
446
+ if (prefix == '_' &&
447
+ element.featureSet.isEnabled (Feature .wildcard_variables)) {
448
+ // A wildcard import prefix is non-binding.
449
+ continue ;
450
+ }
445
451
referenceChildrenBuilder.putIfAbsent (prefix, () => libraries.first);
446
452
}
447
453
return referenceChildrenBuilder;
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ abstract class DartdocTestBase {
41
41
42
42
String get dartCoreUrlPrefix => 'https://api.dart.dev/stable/3.2.0/dart-core' ;
43
43
44
- String get sdkConstraint => '>=3.3 .0 <4.0.0' ;
44
+ String get sdkConstraint => '>=3.6 .0 <4.0.0' ;
45
45
46
46
List <String > get experiments => ['wildcard-variables' ];
47
47
Original file line number Diff line number Diff line change @@ -36,7 +36,6 @@ int x = 0;
36
36
);
37
37
}
38
38
39
- @FailingTest (issue: 'https://github.com/dart-lang/dartdoc/issues/3769' )
40
39
void test_referenced_wildcard () async {
41
40
var library = await bootPackageWithLibrary (
42
41
'''
You can’t perform that action at this time.
0 commit comments