| 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 if (params.validateOnly) { | 227 if (params.validateOnly) { |
| 228 finalStatus = new RefactoringStatus(); | 228 finalStatus = new RefactoringStatus(); |
| 229 return _sendResultResponse(); | 229 return _sendResultResponse(); |
| 230 } | 230 } |
| 231 // validation and create change | 231 // validation and create change |
| 232 refactoring.checkFinalConditions().then((_finalStatus) { | 232 refactoring.checkFinalConditions().then((_finalStatus) { |
| 233 finalStatus = _finalStatus; | 233 finalStatus = _finalStatus; |
| 234 if (_hasFatalError) { | 234 if (_hasFatalError) { |
| 235 return _sendResultResponse(); | 235 return _sendResultResponse(); |
| 236 } | 236 } |
| 237 // create change |
| 237 return refactoring.createChange().then((change) { | 238 return refactoring.createChange().then((change) { |
| 238 result.change = new SourceChange(change.message, edits: change.edits); | 239 result.change = new SourceChange(change.message, edits: change.edits); |
| 239 return _sendResultResponse(); | 240 return _sendResultResponse(); |
| 240 }); | 241 }); |
| 241 }); | 242 }); |
| 242 }); | 243 }); |
| 243 } | 244 } |
| 244 | 245 |
| 245 /** | 246 /** |
| 246 * Initializes this context to perform a refactoring with the specified | 247 * Initializes this context to perform a refactoring with the specified |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 } | 408 } |
| 408 if (refactoring is RenameRefactoring) { | 409 if (refactoring is RenameRefactoring) { |
| 409 RenameRefactoring renameRefactoring = refactoring; | 410 RenameRefactoring renameRefactoring = refactoring; |
| 410 RenameOptions renameOptions = params.options; | 411 RenameOptions renameOptions = params.options; |
| 411 renameRefactoring.newName = renameOptions.newName; | 412 renameRefactoring.newName = renameOptions.newName; |
| 412 return renameRefactoring.checkNewName(); | 413 return renameRefactoring.checkNewName(); |
| 413 } | 414 } |
| 414 return new RefactoringStatus(); | 415 return new RefactoringStatus(); |
| 415 } | 416 } |
| 416 } | 417 } |
| OLD | NEW |