| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * Support for client code that needs to interact with the requests, responses | 6 * Support for client code that needs to interact with the requests, responses |
| 7 * and notifications that are part of the analysis server's wire protocol. | 7 * and notifications that are part of the analysis server's wire protocol. |
| 8 */ | 8 */ |
| 9 library analysis_server.plugin.protocol.protocol; | 9 library analysis_server.plugin.protocol.protocol; |
| 10 | 10 |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 /** | 560 /** |
| 561 * Initialize a newly created instance to represent an error condition caused | 561 * Initialize a newly created instance to represent an error condition caused |
| 562 * by a [request] for a service that is not supported. | 562 * by a [request] for a service that is not supported. |
| 563 */ | 563 */ |
| 564 Response.unsupportedFeature(String requestId, String message) | 564 Response.unsupportedFeature(String requestId, String message) |
| 565 : this(requestId, | 565 : this(requestId, |
| 566 error: new RequestError( | 566 error: new RequestError( |
| 567 RequestErrorCode.UNSUPPORTED_FEATURE, message)); | 567 RequestErrorCode.UNSUPPORTED_FEATURE, message)); |
| 568 | 568 |
| 569 /** | 569 /** |
| 570 * Return a table mapping the names of result fields to their values. Should |
| 571 * be `null` if there is no result to send. |
| 572 */ |
| 573 Map<String, Object> get result => _result; |
| 574 |
| 575 /** |
| 570 * Return a table representing the structure of the Json object that will be | 576 * Return a table representing the structure of the Json object that will be |
| 571 * sent to the client to represent this response. | 577 * sent to the client to represent this response. |
| 572 */ | 578 */ |
| 573 Map<String, Object> toJson() { | 579 Map<String, Object> toJson() { |
| 574 Map<String, Object> jsonObject = new HashMap<String, Object>(); | 580 Map<String, Object> jsonObject = new HashMap<String, Object>(); |
| 575 jsonObject[ID] = id; | 581 jsonObject[ID] = id; |
| 576 if (error != null) { | 582 if (error != null) { |
| 577 jsonObject[ERROR] = error.toJson(); | 583 jsonObject[ERROR] = error.toJson(); |
| 578 } | 584 } |
| 579 if (_result != null) { | 585 if (_result != null) { |
| 580 jsonObject[RESULT] = _result; | 586 jsonObject[RESULT] = _result; |
| 581 } | 587 } |
| 582 return jsonObject; | 588 return jsonObject; |
| 583 } | 589 } |
| 584 } | 590 } |
| OLD | NEW |