| 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/src/analysis_server.dart'; | 9 import 'package:analysis_server/src/analysis_server.dart'; |
| 10 import 'package:analysis_server/src/collections.dart'; | 10 import 'package:analysis_server/src/collections.dart'; |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 return _sendResultResponse(); | 287 return _sendResultResponse(); |
| 288 } | 288 } |
| 289 // create change | 289 // create change |
| 290 return refactoring.createChange().then((change) { | 290 return refactoring.createChange().then((change) { |
| 291 result.change = change; | 291 result.change = change; |
| 292 result.potentialEdits = nullIfEmpty(refactoring.potentialEditIds); | 292 result.potentialEdits = nullIfEmpty(refactoring.potentialEditIds); |
| 293 return _sendResultResponse(); | 293 return _sendResultResponse(); |
| 294 }); | 294 }); |
| 295 }); | 295 }); |
| 296 }).catchError((exception, stackTrace) { | 296 }).catchError((exception, stackTrace) { |
| 297 _reset(); | 297 server.instrumentationService.logException(exception, stackTrace); |
| 298 server.sendResponse( | 298 server.sendResponse( |
| 299 new Response.serverError(request, exception, stackTrace)); | 299 new Response.serverError(request, exception, stackTrace)); |
| 300 _reset(); |
| 300 }); | 301 }); |
| 301 } | 302 } |
| 302 | 303 |
| 303 /** | 304 /** |
| 304 * Initializes this context to perform a refactoring with the specified | 305 * Initializes this context to perform a refactoring with the specified |
| 305 * parameters. The existing [Refactoring] is reused or created as needed. | 306 * parameters. The existing [Refactoring] is reused or created as needed. |
| 306 */ | 307 */ |
| 307 Future<RefactoringStatus> _init(RefactoringKind kind, String file, int offset, | 308 Future<RefactoringStatus> _init(RefactoringKind kind, String file, int offset, |
| 308 int length) { | 309 int length) { |
| 309 // check if we can continue with the existing Refactoring instance | 310 // check if we can continue with the existing Refactoring instance |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 } | 517 } |
| 517 if (refactoring is RenameRefactoring) { | 518 if (refactoring is RenameRefactoring) { |
| 518 RenameRefactoring renameRefactoring = refactoring; | 519 RenameRefactoring renameRefactoring = refactoring; |
| 519 RenameOptions renameOptions = params.options; | 520 RenameOptions renameOptions = params.options; |
| 520 renameRefactoring.newName = renameOptions.newName; | 521 renameRefactoring.newName = renameOptions.newName; |
| 521 return renameRefactoring.checkNewName(); | 522 return renameRefactoring.checkNewName(); |
| 522 } | 523 } |
| 523 return new RefactoringStatus(); | 524 return new RefactoringStatus(); |
| 524 } | 525 } |
| 525 } | 526 } |
| OLD | NEW |