Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1321)

Unified Diff: pkg/analyzer/lib/src/dart/analysis/driver.dart

Issue 2469323004: Mix file: and package: URIs during analysis. (Closed)
Patch Set: Create separate FileState instances for separate URIs for the same path. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/dart/analysis/file_state.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/analysis/driver.dart
diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart
index 7033335f7929b16a378faa5132a6cfac373f515e..02d14cea104a8527e3bd24357a678fac48ac2ba4 100644
--- a/pkg/analyzer/lib/src/dart/analysis/driver.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart
@@ -415,8 +415,9 @@ class AnalysisDriver {
* We need to clean this up.
*/
void _addToStoreUnlinked(
- SummaryDataStore store, String uri, UnlinkedUnit unlinked) {
- store.unlinkedMap[uri] = unlinked;
+ SummaryDataStore store, Uri uri, UnlinkedUnit unlinked) {
+ String uriStr = uri.toString();
+ store.unlinkedMap[uriStr] = unlinked;
}
/**
@@ -429,7 +430,7 @@ class AnalysisDriver {
AnalysisResult _computeAnalysisResult(String path, {bool withUnit: false}) {
// If we don't need the fully resolved unit, check for the cached result.
if (!withUnit) {
- FileState file = _fsState.getFile(path);
+ FileState file = _fsState.getFileForPath(path);
// Prepare the key for the cached result.
String key = _getResolvedUnitKey(file);
if (key == null) {
@@ -534,14 +535,13 @@ class AnalysisDriver {
// Append the defining unit.
{
UnlinkedUnit unlinked = libraryFile.unlinked;
- _addToStoreUnlinked(store, libraryUriStr, unlinked);
+ _addToStoreUnlinked(store, libraryFile.uri, unlinked);
}
// Append parts.
for (FileState part in libraryFile.partedFiles) {
- String partUriStr = part.uri.toString();
UnlinkedUnit unlinked = part.unlinked;
- _addToStoreUnlinked(store, partUriStr, unlinked);
+ _addToStoreUnlinked(store, part.uri, unlinked);
}
// Create nodes for referenced libraries.
@@ -565,7 +565,7 @@ class AnalysisDriver {
if (bytes != null) {
PackageBundle linked = new PackageBundle.fromBuffer(bytes);
_addToStoreLinked(
- store, node.uri.toString(), linked.linkedLibraries.single);
+ store, node.file.uri.toString(), linked.linkedLibraries.single);
} else {
libraryUrisToLink.add(node.uri.toString());
}
@@ -578,15 +578,9 @@ class AnalysisDriver {
_logger.run('Link bundles', () {
linkedLibraries = link(libraryUrisToLink, (String uri) {
LinkedLibrary linkedLibrary = store.linkedMap[uri];
- if (linkedLibrary == null) {
- throw new StateError('No linked library for: $uri');
- }
return linkedLibrary;
}, (String uri) {
UnlinkedUnit unlinkedUnit = store.unlinkedMap[uri];
- if (unlinkedUnit == null) {
- throw new StateError('No unlinked unit for: $uri');
- }
return unlinkedUnit;
}, (_) => null, _analysisOptions.strongMode);
_logger.writeln('Linked ${linkedLibraries.length} bundles.');
@@ -688,7 +682,7 @@ class AnalysisDriver {
*/
FileState _verifyApiSignature(String path) {
return _logger.run('Verify API signature of $path', () {
- FileState file = _fsState.getFile(path);
+ FileState file = _fsState.getFileForPath(path);
bool apiChanged = file.refresh();
Paul Berry 2016/11/03 21:39:34 Don't we need to refresh all files that are associ
scheglov 2016/11/04 04:03:38 Done.
if (apiChanged) {
_logger.writeln('API signatures mismatch found for $path');
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/dart/analysis/file_state.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698