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

Unified Diff: pkg/analyzer_plugin/lib/plugin/plugin.dart

Issue 2969543003: Stop creating unnecessary Source (Closed)
Patch Set: Created 3 years, 6 months 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer_plugin/lib/plugin/plugin.dart
diff --git a/pkg/analyzer_plugin/lib/plugin/plugin.dart b/pkg/analyzer_plugin/lib/plugin/plugin.dart
index 7957ceb16fa2bcf9d6b6f456ca6d92d41d32afcf..be8f70a5a8d94eb91fe319b2bc0f9e8455075af8 100644
--- a/pkg/analyzer_plugin/lib/plugin/plugin.dart
+++ b/pkg/analyzer_plugin/lib/plugin/plugin.dart
@@ -10,7 +10,6 @@ import 'package:analyzer/src/dart/analysis/driver.dart'
show AnalysisDriverGeneric, AnalysisDriverScheduler;
import 'package:analyzer/src/dart/analysis/file_state.dart';
import 'package:analyzer/src/generated/sdk.dart';
-import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer_plugin/channel/channel.dart';
import 'package:analyzer_plugin/protocol/protocol.dart';
import 'package:analyzer_plugin/protocol/protocol_common.dart';
@@ -339,14 +338,10 @@ abstract class ServerPlugin {
AnalysisUpdateContentParams parameters) async {
Map<String, Object> files = parameters.files;
files.forEach((String filePath, Object overlay) {
- // We don't need to get the correct URI because only the full path is
- // used by the contentCache.
- Source source = resourceProvider.getFile(filePath).createSource();
if (overlay is AddContentOverlay) {
- fileContentOverlay[source.fullName] = overlay.content;
+ fileContentOverlay[filePath] = overlay.content;
} else if (overlay is ChangeContentOverlay) {
- String fileName = source.fullName;
- String oldContents = fileContentOverlay[fileName];
+ String oldContents = fileContentOverlay[filePath];
String newContents;
if (oldContents == null) {
// The server should only send a ChangeContentOverlay if there is
@@ -360,9 +355,9 @@ abstract class ServerPlugin {
throw new RequestFailure(
RequestErrorFactory.invalidOverlayChangeInvalidEdit());
}
- fileContentOverlay[fileName] = newContents;
+ fileContentOverlay[filePath] = newContents;
} else if (overlay is RemoveContentOverlay) {
- fileContentOverlay[source.fullName] = null;
+ fileContentOverlay[filePath] = null;
}
contentChanged(filePath);
});
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698