Skip to content

Clear the map of relative URIs on DartUri.clear() #2216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions dwds/lib/src/utilities/dart_uri.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ class DartUri {
/// All of the known libraries, indexed by their absolute file URL.
static final Map<String, String> _resolvedUriToUri = {};

/// Returns a resolved path for a g3-relative URI.
///
/// This map is empty if not a google3 app.
static final Map<String, String> _g3RelativeUriToResolvedUri = {};

/// Returns package, app, or dart uri for a resolved path.
static String? toPackageUri(String uri) {
final packageUri = _resolvedUriToUri[uri];
Expand All @@ -152,11 +157,6 @@ class DartUri {
/// Returns resolved path for a package, app, or dart uri.
static String? toResolvedUri(String uri) => _uriToResolvedUri[uri];

/// Returns a resolved path for a g3-relative URI.
///
/// This map is empty if not a google3 app.
static final Map<String, String> _g3RelativeUriToResolvedUri = {};

/// The directory in which we're running.
///
/// We store this here because for tests we may want to act as if we're
Expand All @@ -178,6 +178,7 @@ class DartUri {
_packageConfig = null;
_resolvedUriToUri.clear();
_uriToResolvedUri.clear();
_g3RelativeUriToResolvedUri.clear();
}

/// Record all of the libraries, indexed by their absolute file: URI.
Expand Down