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

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

Issue 2518903002: Make SearchMatch an interface, exclude 'context', move implementation. (Closed)
Patch Set: 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/analysis_server/lib/src/search/element_references.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/protocol_server.dart
diff --git a/pkg/analysis_server/lib/src/protocol_server.dart b/pkg/analysis_server/lib/src/protocol_server.dart
index e6607ca24df4275f4e67225e7c139f26ec4bb7ba..51f171d33486987d2e7b1c2dc92f160b2b6b9ac2 100644
--- a/pkg/analysis_server/lib/src/protocol_server.dart
+++ b/pkg/analysis_server/lib/src/protocol_server.dart
@@ -52,23 +52,22 @@ List<AnalysisError> doAnalysisError_listFromEngine(
}
/**
- * Adds [edit] to the [FileEdit] for the given [element].
+ * Adds [edit] to the file with the [element] for the given [element].
Brian Wilkerson 2016/11/21 15:00:56 This seems redundant. Perhaps "to the file contain
*/
void doSourceChange_addElementEdit(
SourceChange change, engine.Element element, SourceEdit edit) {
- engine.AnalysisContext context = element.context;
engine.Source source = element.source;
- doSourceChange_addSourceEdit(change, context, source, edit);
+ doSourceChange_addSourceEdit(change, source, edit);
}
/**
- * Adds [edit] to the [FileEdit] for the given [source].
+ * Adds [edit] for the given [source] to the [change].
*/
-void doSourceChange_addSourceEdit(SourceChange change,
- engine.AnalysisContext context, engine.Source source, SourceEdit edit) {
+void doSourceChange_addSourceEdit(
+ SourceChange change, engine.Source source, SourceEdit edit,
+ {bool isNewFile: false}) {
String file = source.fullName;
- int fileStamp = context.getModificationStamp(source);
- change.addEdit(file, fileStamp, edit);
+ change.addEdit(file, isNewFile ? -1 : 0, edit);
}
String getReturnTypeString(engine.Element element) {
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/search/element_references.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698