Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: pkg/analysis_server/lib/src/services/refactoring/refactoring.dart

Issue 1431673003: Compute covering offsets/lengths. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 services.refactoring; 5 library services.refactoring;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/plugin/protocol/protocol.dart' 9 import 'package:analysis_server/plugin/protocol/protocol.dart'
10 show RefactoringMethodParameter, SourceChange; 10 show RefactoringMethodParameter, SourceChange;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 /** 65 /**
66 * Returns a new [ExtractLocalRefactoring] instance. 66 * Returns a new [ExtractLocalRefactoring] instance.
67 */ 67 */
68 factory ExtractLocalRefactoring( 68 factory ExtractLocalRefactoring(
69 CompilationUnit unit, int selectionOffset, int selectionLength) { 69 CompilationUnit unit, int selectionOffset, int selectionLength) {
70 return new ExtractLocalRefactoringImpl( 70 return new ExtractLocalRefactoringImpl(
71 unit, selectionOffset, selectionLength); 71 unit, selectionOffset, selectionLength);
72 } 72 }
73 73
74 /** 74 /**
75 * The lengths of the expressions that cover the specified selection,
76 * from the down most to the up most.
77 */
78 List<int> get coveringExpressionLengths;
79
80 /**
81 * The offsets of the expressions that cover the specified selection,
82 * from the down most to the up most.
83 */
84 List<int> get coveringExpressionOffsets;
85
86 /**
75 * True if all occurrences of the expression within the scope in which the 87 * True if all occurrences of the expression within the scope in which the
76 * variable will be defined should be replaced by a reference to the local 88 * variable will be defined should be replaced by a reference to the local
77 * variable. The expression used to initiate the refactoring will always be 89 * variable. The expression used to initiate the refactoring will always be
78 * replaced. 90 * replaced.
79 */ 91 */
80 void set extractAll(bool extractAll); 92 void set extractAll(bool extractAll);
81 93
82 /** 94 /**
83 * The lengths of the expressions that would be replaced by a reference to the 95 * The lengths of the expressions that would be replaced by a reference to the
84 * variable. The lengths correspond to the offsets. In other words, for a 96 * variable. The lengths correspond to the offsets. In other words, for a
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 * Validates that the [newName] is a valid identifier and is appropriate for 418 * Validates that the [newName] is a valid identifier and is appropriate for
407 * the type of the [Element] being renamed. 419 * the type of the [Element] being renamed.
408 * 420 *
409 * It does not perform all the checks (such as checking for conflicts with any 421 * It does not perform all the checks (such as checking for conflicts with any
410 * existing names in any of the scopes containing the current name), as many 422 * existing names in any of the scopes containing the current name), as many
411 * of these checkes require search engine. Use [checkFinalConditions] for this 423 * of these checkes require search engine. Use [checkFinalConditions] for this
412 * level of checking. 424 * level of checking.
413 */ 425 */
414 RefactoringStatus checkNewName(); 426 RefactoringStatus checkNewName();
415 } 427 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698