| 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 }); | 287 }); |
| 288 }); | 288 }); |
| 289 } | 289 } |
| 290 | 290 |
| 291 /** | 291 /** |
| 292 * Initializes this context to perform a refactoring with the specified | 292 * Initializes this context to perform a refactoring with the specified |
| 293 * parameters. The existing [Refactoring] is reused or created as needed. | 293 * parameters. The existing [Refactoring] is reused or created as needed. |
| 294 */ | 294 */ |
| 295 Future<RefactoringStatus> _init(RefactoringKind kind, String file, int offset, | 295 Future<RefactoringStatus> _init(RefactoringKind kind, String file, int offset, |
| 296 int length) { | 296 int length) { |
| 297 List<RefactoringProblem> problems = <RefactoringProblem>[]; | |
| 298 // check if we can continue with the existing Refactoring instance | 297 // check if we can continue with the existing Refactoring instance |
| 299 if (this.kind == kind && | 298 if (this.kind == kind && |
| 300 this.file == file && | 299 this.file == file && |
| 301 this.offset == offset && | 300 this.offset == offset && |
| 302 this.length == length) { | 301 this.length == length) { |
| 303 return new Future.value(initStatus); | 302 return new Future.value(initStatus); |
| 304 } | 303 } |
| 305 _reset(); | 304 _reset(); |
| 306 this.kind = kind; | 305 this.kind = kind; |
| 307 this.file = file; | 306 this.file = file; |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 } | 490 } |
| 492 if (refactoring is RenameRefactoring) { | 491 if (refactoring is RenameRefactoring) { |
| 493 RenameRefactoring renameRefactoring = refactoring; | 492 RenameRefactoring renameRefactoring = refactoring; |
| 494 RenameOptions renameOptions = params.options; | 493 RenameOptions renameOptions = params.options; |
| 495 renameRefactoring.newName = renameOptions.newName; | 494 renameRefactoring.newName = renameOptions.newName; |
| 496 return renameRefactoring.checkNewName(); | 495 return renameRefactoring.checkNewName(); |
| 497 } | 496 } |
| 498 return new RefactoringStatus(); | 497 return new RefactoringStatus(); |
| 499 } | 498 } |
| 500 } | 499 } |
| OLD | NEW |