File tree Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import 'package:dartdoc/src/render/model_element_renderer.dart';
15
15
import 'package:dartdoc/src/render/parameter_renderer.dart' ;
16
16
import 'package:dartdoc/src/render/typedef_renderer.dart' ;
17
17
import 'package:dartdoc/src/special_elements.dart' ;
18
+ import 'package:dartdoc/src/tuple.dart' ;
18
19
import 'package:dartdoc/src/warnings.dart' ;
19
20
import 'package:test/test.dart' ;
20
21
@@ -882,6 +883,24 @@ void main() {
882
883
docsAsHtml = doAwesomeStuff.documentationAsHtml;
883
884
});
884
885
886
+ test ('Verify links to inherited members inside class' , () {
887
+ expect (
888
+ docsAsHtml,
889
+ contains (
890
+ '<a href="${HTMLBASE_PLACEHOLDER }fake/ImplicitProperties/forInheriting.html">ClassWithUnusualProperties.forInheriting</a>' ));
891
+ expect (
892
+ docsAsHtml,
893
+ contains (
894
+ '<a href="%%__HTMLBASE_dartdoc_internal__%%reexport_two/BaseReexported/action.html">ExtendedBaseReexported.action</a></p>' ));
895
+ var doAwesomeStuffWarnings = packageGraph.packageWarningCounter
896
+ .countedWarnings[doAwesomeStuff.element] ??
897
+ [];
898
+ expect (
899
+ doAwesomeStuffWarnings,
900
+ isNot (anyElement ((Tuple2 <PackageWarning , String > e) =>
901
+ e.item1 == PackageWarning .ambiguousDocReference)));
902
+ });
903
+
885
904
test ('can handle renamed imports' , () {
886
905
var aFunctionUsingRenamedLib = fakeLibrary.functions
887
906
.firstWhere ((f) => f.name == 'aFunctionUsingRenamedLib' );
Original file line number Diff line number Diff line change @@ -858,6 +858,7 @@ class ExtraSpecialList<E> extends SpecialList {}
858
858
/// {@subCategory Things and Such}
859
859
/// {@image https://flutter.io/images/catalog-widget-placeholder.png}
860
860
/// {@samples https://flutter.io}
861
+ ///
861
862
class BaseForDocComments {
862
863
/// Takes a [value] and returns a String.
863
864
///
@@ -899,6 +900,10 @@ class BaseForDocComments {
899
900
///
900
901
/// Reference to something that doesn't exist containing a type parameter [ThisIsNotHereNoWay<MyType>]
901
902
///
903
+ /// Reference to an inherited member: [ClassWithUnusualProperties.forInheriting]
904
+ ///
905
+ /// Reference to an inherited member in another library via class name: [ExtendedBaseReexported.action]
906
+ ///
902
907
/// Link to a nonexistent file (erroneously expects base href): [link] (SubForDocComments/localMethod.html)
903
908
///
904
909
/// Link to an existing file: [link] (../SubForDocComments/localMethod.html)
Original file line number Diff line number Diff line change @@ -8,6 +8,13 @@ class YetAnotherClass {}
8
8
9
9
class AUnicornClass {}
10
10
11
+ class BaseReexported {
12
+ String action;
13
+ }
14
+
15
+ class ExtendedBaseReexported extends BaseReexported {
16
+ }
17
+
11
18
/// A private extension.
12
19
extension _Unseen on Object {
13
20
void doYouSeeMe () { }
@@ -21,4 +28,4 @@ extension on List {
21
28
/// [_Unseen] is not seen, but [DocumentMe] is.
22
29
extension DocumentThisExtensionOnce on String {
23
30
String get reportOnString => '$this is wonderful' ;
24
- }
31
+ }
You can’t perform that action at this time.
0 commit comments