File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -512,11 +512,10 @@ abstract class ModelElement
512512 // This is not accurate if we are still constructing the Package.
513513 assert (packageGraph.allLibrariesAdded);
514514
515- var definingLibraryIsLocalPublic =
516- packageGraph.localPublicLibraries.contains (library);
517- var possibleCanonicalLibrary = definingLibraryIsLocalPublic
518- ? library
519- : canonicalLibraryCandidate (this );
515+ var definingLibraryIsPublic =
516+ packageGraph.publicLibraries.contains (library);
517+ var possibleCanonicalLibrary =
518+ definingLibraryIsPublic ? library : canonicalLibraryCandidate (this );
520519
521520 if (possibleCanonicalLibrary != null ) return possibleCanonicalLibrary;
522521
Original file line number Diff line number Diff line change @@ -263,6 +263,7 @@ library bar;
263263 .writeAsStringSync ('''
264264/// Documentation comment.
265265library one;
266+ export 'some_other_lib.dart' show Exported;
266267
267268class One {}
268269''' );
@@ -276,6 +277,10 @@ library script;
276277
277278class Script {}
278279''' );
280+ packageOneRoot
281+ .getChildAssumingFolder ('lib' )
282+ .getChildAssumingFile ('some_other_lib.dart' )
283+ .writeAsStringSync ('''class Exported {}''' );
279284
280285 packageTwoRoot =
281286 utils.writePackage ('two' , resourceProvider, packageConfigProvider);
@@ -316,6 +321,12 @@ dartdoc:
316321 expect (packageOne.documentedWhere, equals (DocumentLocation .remote));
317322 expect (classOne.href,
318323 equals ('https://mypub.topdomain/one/0.0.1/one/One-class.html' ));
324+ // Validate that canonicalization takes place for remote packages.
325+ var exported = libraryOne.classes.named ('Exported' );
326+ expect (
327+ exported.href,
328+ equals (
329+ 'https://mypub.topdomain/one/0.0.1/some_other_lib/Exported-class.html' ));
319330 });
320331
321332 test (
You can’t perform that action at this time.
0 commit comments