Chromium Code Reviews| 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) { |