@@ -446,8 +446,9 @@ class BazelWorkspace extends Workspace
446446 return writableFile;
447447 }
448448 // READONLY
449+ var readonly = this .readonly;
449450 if (readonly != null ) {
450- File file = provider.getFile (context.join (readonly! , relative));
451+ File file = provider.getFile (context.join (readonly, relative));
451452 if (file.exists) {
452453 return file;
453454 }
@@ -573,8 +574,9 @@ class BazelWorkspace extends Workspace
573574 }
574575 }
575576 // READONLY
577+ var readonly = this .readonly;
576578 if (readonly != null ) {
577- if (context.isWithin (readonly! , p)) {
579+ if (context.isWithin (readonly, p)) {
578580 return context.relative (p, from: readonly);
579581 }
580582 }
@@ -751,21 +753,13 @@ class BazelWorkspacePackage extends WorkspacePackage {
751753
752754 @override
753755 bool contains (Source source) {
754- if (source.uri.isScheme ('package' )) {
755- return source.uri.toString ().startsWith (_uriPrefix);
756- }
757- var filePath = source.fullName;
758- if (workspace.findFile (filePath) == null ) {
759- return false ;
760- }
761- if (! workspace.provider.pathContext.isWithin (root, filePath)) {
762- return false ;
756+ var uri = source.uri;
757+ if (uri.isScheme ('package' )) {
758+ return uri.toString ().startsWith (_uriPrefix);
763759 }
764760
765- // Just because [filePath] is within [root] does not mean it is in this
766- // package; it could be in a "subpackage." Must go through the work of
767- // learning exactly which package [filePath] is contained in.
768- return workspace.findPackageFor (filePath)! .root == root;
761+ var path = source.fullName;
762+ return workspace.findPackageFor (path)? .root == root;
769763 }
770764
771765 @override
0 commit comments