Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | |
| 2 // for details. All rights reserved. Use of this source code is governed by a | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 /** | |
| 6 * Operations to be performed during the simulation. | |
| 7 */ | |
| 8 library analysis_server.test.stress.replay.replay; | |
|
scheglov
2015/11/20 22:52:18
library analysis_server.test.stress.replay.operati
| |
| 9 | |
| 10 import '../utilities/server.dart'; | |
| 11 import 'package:analysis_server/plugin/protocol/protocol.dart'; | |
|
scheglov
2015/11/20 22:52:18
Sort?
| |
| 12 | |
| 13 /** | |
| 14 * An operation to be performed during the simulation. | |
| 15 */ | |
| 16 abstract class ServerOperation { | |
| 17 /** | |
| 18 * Perform this operation by communicating with the given [server]. | |
| 19 */ | |
| 20 void perform(Server server); | |
| 21 } | |
| 22 | |
| 23 /** | |
| 24 * An operation that will send an 'analysis.updateContent' request. | |
| 25 */ | |
| 26 class AnalysisUpdateContent extends ServerOperation { | |
| 27 /** | |
| 28 * The path of the file whose content is being updated. | |
| 29 */ | |
| 30 String filePath; | |
| 31 | |
| 32 /** | |
| 33 * The overlay used to update the content. | |
| 34 */ | |
| 35 dynamic overlay; | |
| 36 | |
| 37 /** | |
| 38 * Initialize an operation to send an 'analysis.updateContent' request with | |
| 39 * the given [filePath] and [overlay] as parameters. | |
| 40 */ | |
| 41 AnalysisUpdateContent(this.filePath, this.overlay); | |
| 42 | |
| 43 @override | |
| 44 void perform(Server server) { | |
| 45 server.sendAnalysisUpdateContent({filePath: overlay}); | |
| 46 // if (overlay is ChangeContentOverlay) { | |
| 47 // List<SourceEdit> edits = (overlay as ChangeContentOverlay).edits; | |
| 48 // if (edits.length == 1) { | |
| 49 // SourceEdit edit = edits[0]; | |
| 50 // if (edit.replacement.endsWith('.')) { | |
| 51 // int offset = edit.offset + edit.replacement.length - 1; | |
| 52 // server.sendCompletionGetSuggestions(filePath, offset); | |
| 53 // } | |
| 54 // } | |
| 55 // } | |
| 56 } | |
| 57 } | |
| OLD | NEW |