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 import 'dart:convert' hide JsonDecoder; | 9 import 'dart:convert' hide JsonDecoder; |
10 | 10 |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 * Initialize a newly created instance to represent the | 463 * Initialize a newly created instance to represent the |
464 * GET_ERRORS_INVALID_FILE error condition. | 464 * GET_ERRORS_INVALID_FILE error condition. |
465 */ | 465 */ |
466 Response.getErrorsInvalidFile(Request request) | 466 Response.getErrorsInvalidFile(Request request) |
467 : this(request.id, | 467 : this(request.id, |
468 error: new RequestError(RequestErrorCode.GET_ERRORS_INVALID_FILE, | 468 error: new RequestError(RequestErrorCode.GET_ERRORS_INVALID_FILE, |
469 'Error during `analysis.getErrors`: invalid file.')); | 469 'Error during `analysis.getErrors`: invalid file.')); |
470 | 470 |
471 /** | 471 /** |
472 * Initialize a newly created instance to represent the | 472 * Initialize a newly created instance to represent the |
| 473 * GET_IMPORTED_ELEMENTS_INVALID_FILE error condition. |
| 474 */ |
| 475 Response.getImportedElementsInvalidFile(Request request) |
| 476 : this(request.id, |
| 477 error: new RequestError( |
| 478 RequestErrorCode.GET_IMPORTED_ELEMENTS_INVALID_FILE, |
| 479 'Error during `analysis.getImportedElements`: invalid file.')); |
| 480 |
| 481 /** |
| 482 * Initialize a newly created instance to represent the |
473 * GET_NAVIGATION_INVALID_FILE error condition. | 483 * GET_NAVIGATION_INVALID_FILE error condition. |
474 */ | 484 */ |
475 Response.getNavigationInvalidFile(Request request) | 485 Response.getNavigationInvalidFile(Request request) |
476 : this(request.id, | 486 : this(request.id, |
477 error: new RequestError( | 487 error: new RequestError( |
478 RequestErrorCode.GET_NAVIGATION_INVALID_FILE, | 488 RequestErrorCode.GET_NAVIGATION_INVALID_FILE, |
479 'Error during `analysis.getNavigation`: invalid file.')); | 489 'Error during `analysis.getNavigation`: invalid file.')); |
480 | 490 |
481 /** | 491 /** |
482 * Initialize a newly created instance to represent the | 492 * Initialize a newly created instance to represent the |
483 * GET_REACHABLE_SOURCES_INVALID_FILE error condition. | 493 * GET_REACHABLE_SOURCES_INVALID_FILE error condition. |
484 */ | 494 */ |
485 Response.getReachableSourcesInvalidFile(Request request) | 495 Response.getReachableSourcesInvalidFile(Request request) |
486 : this(request.id, | 496 : this(request.id, |
487 error: new RequestError( | 497 error: new RequestError( |
488 RequestErrorCode.GET_REACHABLE_SOURCES_INVALID_FILE, | 498 RequestErrorCode.GET_REACHABLE_SOURCES_INVALID_FILE, |
489 'Error during `analysis.getReachableSources`: invalid file.')); | 499 'Error during `analysis.getReachableSources`: invalid file.')); |
490 | 500 |
491 /** | 501 /** |
| 502 * Initialize a newly created instance to represent the |
| 503 * IMPORT_ELEMENTS_INVALID_FILE error condition. |
| 504 */ |
| 505 Response.importElementsInvalidFile(Request request) |
| 506 : this(request.id, |
| 507 error: new RequestError( |
| 508 RequestErrorCode.IMPORT_ELEMENTS_INVALID_FILE, |
| 509 'Error during `edit.importElements`: invalid file.')); |
| 510 |
| 511 /** |
492 * Initialize a newly created instance to represent an error condition caused | 512 * Initialize a newly created instance to represent an error condition caused |
493 * by an analysis.reanalyze [request] that specifies an analysis root that is | 513 * by an analysis.reanalyze [request] that specifies an analysis root that is |
494 * not in the current list of analysis roots. | 514 * not in the current list of analysis roots. |
495 */ | 515 */ |
496 Response.invalidAnalysisRoot(Request request, String rootPath) | 516 Response.invalidAnalysisRoot(Request request, String rootPath) |
497 : this(request.id, | 517 : this(request.id, |
498 error: new RequestError(RequestErrorCode.INVALID_ANALYSIS_ROOT, | 518 error: new RequestError(RequestErrorCode.INVALID_ANALYSIS_ROOT, |
499 "Invalid analysis root: $rootPath")); | 519 "Invalid analysis root: $rootPath")); |
500 | 520 |
501 /** | 521 /** |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 jsonObject[ID] = id; | 654 jsonObject[ID] = id; |
635 if (error != null) { | 655 if (error != null) { |
636 jsonObject[ERROR] = error.toJson(); | 656 jsonObject[ERROR] = error.toJson(); |
637 } | 657 } |
638 if (result != null) { | 658 if (result != null) { |
639 jsonObject[RESULT] = result; | 659 jsonObject[RESULT] = result; |
640 } | 660 } |
641 return jsonObject; | 661 return jsonObject; |
642 } | 662 } |
643 } | 663 } |
OLD | NEW |