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

Unified Diff: pkg/analysis_server/lib/src/protocol.dart

Issue 580273002: Push add*Edit helpers into SourceChange. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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
Index: pkg/analysis_server/lib/src/protocol.dart
diff --git a/pkg/analysis_server/lib/src/protocol.dart b/pkg/analysis_server/lib/src/protocol.dart
index 175c166394f9a976b449493265f61ba48c3eb333..0436d0af0fc37d909ecc993e44f9849575ee4c2c 100644
--- a/pkg/analysis_server/lib/src/protocol.dart
+++ b/pkg/analysis_server/lib/src/protocol.dart
@@ -78,6 +78,22 @@ void _addEditToSourceChange(SourceChange change, String file, int fileStamp,
fileEdit.add(edit);
}
+
+void _addElementEditToSourceChange(SourceChange change, engine.Element element,
+ SourceEdit edit) {
+ engine.AnalysisContext context = element.context;
+ engine.Source source = element.source;
+ _addSourceEditToSourceChange(change, context, source, edit);
+}
+
+
+void _addSourceEditToSourceChange(SourceChange change,
+ engine.AnalysisContext context, engine.Source source, SourceEdit edit) {
+ String file = source.fullName;
+ int fileStamp = context.getModificationStamp(source);
+ change.addEdit(file, fileStamp, edit);
+}
+
/**
* Create an AnalysisError based on error information from the analyzer
* engine. Access via AnalysisError.fromEngine().
« no previous file with comments | « pkg/analysis_server/lib/src/generated_protocol.dart ('k') | pkg/analysis_server/lib/src/services/correction/util.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698