Skip to content

Commit 49ec27d

Browse files
committed
Respect --no-link-to-remote
1 parent 84ce4e1 commit 49ec27d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/src/model/model_element.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,11 @@ abstract class ModelElement
512512
// This is not accurate if we are still constructing the Package.
513513
assert(packageGraph.allLibrariesAdded);
514514

515+
var isLocalLibrary = packageGraph.localLibraries.contains(library);
516+
if (!isLocalLibrary && !config.linkToRemote) {
517+
return null;
518+
}
519+
515520
var definingLibraryIsPublic =
516521
packageGraph.publicLibraries.contains(library);
517522
var possibleCanonicalLibrary =

lib/src/model/package_graph.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,15 +679,15 @@ class PackageGraph with CommentReferable, Nameable {
679679
return libraries.wherePublic.toSet();
680680
}();
681681

682-
late final List<Library> _localLibraries = () {
682+
late final List<Library> localLibraries = () {
683683
assert(allLibrariesAdded);
684684
return localPackages.expand((p) => p.libraries).toList(growable: false)
685685
..sort();
686686
}();
687687

688688
late final Set<Library> localPublicLibraries = () {
689689
assert(allLibrariesAdded);
690-
return _localLibraries.wherePublic.toSet();
690+
return localLibraries.wherePublic.toSet();
691691
}();
692692

693693
/// The String name representing the `Object` type.

0 commit comments

Comments
 (0)