| 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/constants.dart'; | 10 import 'package:analysis_server/src/constants.dart'; |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 } | 273 } |
| 274 // validation and create change | 274 // validation and create change |
| 275 refactoring.checkFinalConditions().then((_finalStatus) { | 275 refactoring.checkFinalConditions().then((_finalStatus) { |
| 276 finalStatus = _finalStatus; | 276 finalStatus = _finalStatus; |
| 277 if (_hasFatalError) { | 277 if (_hasFatalError) { |
| 278 return _sendResultResponse(); | 278 return _sendResultResponse(); |
| 279 } | 279 } |
| 280 // create change | 280 // create change |
| 281 return refactoring.createChange().then((change) { | 281 return refactoring.createChange().then((change) { |
| 282 result.change = change; | 282 result.change = change; |
| 283 result.potentialEdits = refactoring.potentialEditIds; | 283 if (!refactoring.potentialEditIds.isEmpty) { |
| 284 result.potentialEdits = refactoring.potentialEditIds; |
| 285 } |
| 284 return _sendResultResponse(); | 286 return _sendResultResponse(); |
| 285 }); | 287 }); |
| 286 }); | 288 }); |
| 287 }); | 289 }); |
| 288 } | 290 } |
| 289 | 291 |
| 290 /** | 292 /** |
| 291 * Initializes this context to perform a refactoring with the specified | 293 * Initializes this context to perform a refactoring with the specified |
| 292 * parameters. The existing [Refactoring] is reused or created as needed. | 294 * parameters. The existing [Refactoring] is reused or created as needed. |
| 293 */ | 295 */ |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 } | 492 } |
| 491 if (refactoring is RenameRefactoring) { | 493 if (refactoring is RenameRefactoring) { |
| 492 RenameRefactoring renameRefactoring = refactoring; | 494 RenameRefactoring renameRefactoring = refactoring; |
| 493 RenameOptions renameOptions = params.options; | 495 RenameOptions renameOptions = params.options; |
| 494 renameRefactoring.newName = renameOptions.newName; | 496 renameRefactoring.newName = renameOptions.newName; |
| 495 return renameRefactoring.checkNewName(); | 497 return renameRefactoring.checkNewName(); |
| 496 } | 498 } |
| 497 return new RefactoringStatus(); | 499 return new RefactoringStatus(); |
| 498 } | 500 } |
| 499 } | 501 } |
| OLD | NEW |