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;
77
88import 'dart:core' ;
99
10+ import 'package:analyzer/dart/analysis/features.dart' ;
1011import 'package:analyzer/dart/element/element.dart' ;
1112import 'package:analyzer/dart/element/scope.dart' ;
1213import 'package:collection/collection.dart' ;
1314import 'package:dartdoc/src/model/library.dart' ;
1415import 'package:dartdoc/src/model/model_element.dart' ;
1516import 'package:dartdoc/src/model/nameable.dart' ;
17+ import 'package:dartdoc/src/model/prefix.dart' ;
1618import 'package:meta/meta.dart' ;
1719
1820class _ReferenceChildrenLookup {
@@ -55,6 +57,12 @@ mixin CommentReferable implements Nameable {
5557 // First attempt: Ask analyzer's `Scope.lookup` API.
5658 var result = _lookupViaScope (referenceLookup, filter: filter);
5759 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+ }
5866 return result;
5967 }
6068
Original file line number Diff line number Diff line change 22// for details. All rights reserved. Use of this source code is governed by a
33// BSD-style license that can be found in the LICENSE file.
44
5+ import 'package:analyzer/dart/analysis/features.dart' ;
56import 'package:analyzer/dart/element/element.dart' ;
67import 'package:analyzer/dart/element/scope.dart' ;
78import 'package:analyzer/source/line_info.dart' ;
@@ -442,6 +443,11 @@ class Library extends ModelElement
442443 // ambiguous. dart-lang/dartdoc#2683.
443444 for (var MapEntry (key: prefix, value: libraries)
444445 in _prefixToLibrary.entries) {
446+ if (prefix == '_' &&
447+ element.featureSet.isEnabled (Feature .wildcard_variables)) {
448+ // A wildcard import prefix is non-binding.
449+ continue ;
450+ }
445451 referenceChildrenBuilder.putIfAbsent (prefix, () => libraries.first);
446452 }
447453 return referenceChildrenBuilder;
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ abstract class DartdocTestBase {
4141
4242 String get dartCoreUrlPrefix => 'https://api.dart.dev/stable/3.2.0/dart-core' ;
4343
44- String get sdkConstraint => '>=3.3 .0 <4.0.0' ;
44+ String get sdkConstraint => '>=3.6 .0 <4.0.0' ;
4545
4646 List <String > get experiments => ['wildcard-variables' ];
4747
Original file line number Diff line number Diff line change @@ -36,7 +36,6 @@ int x = 0;
3636 );
3737 }
3838
39- @FailingTest (issue: 'https://github.com/dart-lang/dartdoc/issues/3769' )
4039 void test_referenced_wildcard () async {
4140 var library = await bootPackageWithLibrary (
4241 '''
You can’t perform that action at this time.
0 commit comments