| 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 library edit.domain; | 5 library edit.domain; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/plugin/edit/assist/assist_core.dart'; | 9 import 'package:analysis_server/plugin/edit/assist/assist_core.dart'; |
| 10 import 'package:analysis_server/plugin/edit/assist/assist_dart.dart'; | 10 import 'package:analysis_server/plugin/edit/assist/assist_dart.dart'; |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 refactoring is ExtractMethodRefactoring || | 580 refactoring is ExtractMethodRefactoring || |
| 581 refactoring is InlineMethodRefactoring || | 581 refactoring is InlineMethodRefactoring || |
| 582 refactoring is MoveFileRefactoring || | 582 refactoring is MoveFileRefactoring || |
| 583 refactoring is RenameRefactoring; | 583 refactoring is RenameRefactoring; |
| 584 } | 584 } |
| 585 | 585 |
| 586 /** | 586 /** |
| 587 * Cancels processing of the current request and cleans up. | 587 * Cancels processing of the current request and cleans up. |
| 588 */ | 588 */ |
| 589 void cancel() { | 589 void cancel() { |
| 590 server.sendResponse(new Response.refactoringRequestCancelled(request)); | 590 if (request != null) { |
| 591 request = null; | 591 server.sendResponse(new Response.refactoringRequestCancelled(request)); |
| 592 request = null; |
| 593 } |
| 592 _reset(); | 594 _reset(); |
| 593 } | 595 } |
| 594 | 596 |
| 595 void getRefactoring(Request _request) { | 597 void getRefactoring(Request _request) { |
| 596 // prepare for processing the request | 598 // prepare for processing the request |
| 597 request = _request; | 599 request = _request; |
| 598 result = new EditGetRefactoringResult( | 600 result = new EditGetRefactoringResult( |
| 599 EMPTY_PROBLEM_LIST, EMPTY_PROBLEM_LIST, EMPTY_PROBLEM_LIST); | 601 EMPTY_PROBLEM_LIST, EMPTY_PROBLEM_LIST, EMPTY_PROBLEM_LIST); |
| 600 // process the request | 602 // process the request |
| 601 var params = new EditGetRefactoringParams.fromRequest(_request); | 603 var params = new EditGetRefactoringParams.fromRequest(_request); |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 969 } | 971 } |
| 970 return new RefactoringStatus(); | 972 return new RefactoringStatus(); |
| 971 } | 973 } |
| 972 } | 974 } |
| 973 | 975 |
| 974 /** | 976 /** |
| 975 * [_RefactoringManager] throws instances of this class internally to stop | 977 * [_RefactoringManager] throws instances of this class internally to stop |
| 976 * processing in a manager that was reset. | 978 * processing in a manager that was reset. |
| 977 */ | 979 */ |
| 978 class _ResetError {} | 980 class _ResetError {} |
| OLD | NEW |