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
512
512
// This is not accurate if we are still constructing the Package.
513
513
assert (packageGraph.allLibrariesAdded);
514
514
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 );
520
519
521
520
if (possibleCanonicalLibrary != null ) return possibleCanonicalLibrary;
522
521
Original file line number Diff line number Diff line change @@ -263,6 +263,7 @@ library bar;
263
263
.writeAsStringSync ('''
264
264
/// Documentation comment.
265
265
library one;
266
+ export 'some_other_lib.dart' show Exported;
266
267
267
268
class One {}
268
269
''' );
@@ -276,6 +277,10 @@ library script;
276
277
277
278
class Script {}
278
279
''' );
280
+ packageOneRoot
281
+ .getChildAssumingFolder ('lib' )
282
+ .getChildAssumingFile ('some_other_lib.dart' )
283
+ .writeAsStringSync ('''class Exported {}''' );
279
284
280
285
packageTwoRoot =
281
286
utils.writePackage ('two' , resourceProvider, packageConfigProvider);
@@ -316,6 +321,12 @@ dartdoc:
316
321
expect (packageOne.documentedWhere, equals (DocumentLocation .remote));
317
322
expect (classOne.href,
318
323
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' ));
319
330
});
320
331
321
332
test (
You can’t perform that action at this time.
0 commit comments