Skip to content

Commit 1790fb7

Browse files
srawlinsCommit Queue
authored andcommitted
DAS: Fix comment references in refactoring/
Change-Id: Iaf710c67029cc75e2e61c4c5761c790938a9113d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403560 Commit-Queue: Samuel Rawlins <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]>
1 parent 66624da commit 1790fb7

13 files changed

+32
-31
lines changed

pkg/analysis_server/lib/src/services/refactoring/legacy/extract_local.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ class ExtractLocalRefactoringImpl extends RefactoringImpl
391391
);
392392
}
393393

394-
/// Return an unique identifier for the given [Element], or `null` if
394+
/// Return an unique identifier for the given [Element2], or `null` if
395395
/// [element] is `null`.
396396
int? _encodeElement(Element2? element) {
397397
if (element == null) {
@@ -405,8 +405,9 @@ class ExtractLocalRefactoringImpl extends RefactoringImpl
405405
return id;
406406
}
407407

408-
/// Returns an [Element]-sensitive encoding of [tokens].
409-
/// Each [Token] with a [LocalVariableElement] has a suffix of the element id.
408+
/// Returns an [Element2]-sensitive encoding of [tokens].
409+
/// Each [Token] with a [LocalVariableElement2] has a suffix of the element
410+
/// ID.
410411
///
411412
/// So, we can distinguish different local variables with the same name, if
412413
/// there are multiple variables with the same name are declared in the

pkg/analysis_server/lib/src/services/refactoring/legacy/extract_method.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import 'package:meta/meta.dart';
4343
const String _tokenSeparator = '\uFFFF';
4444

4545
/// Adds edits to the given [change] that ensure that all the [libraries] are
46-
/// imported into the given [targetLibrary].
46+
/// imported into the given [targetLibrary2].
4747
@visibleForTesting
4848
Future<void> addLibraryImports(
4949
AnalysisSession session,
@@ -667,8 +667,8 @@ final class ExtractMethodRefactoringImpl extends RefactoringImpl
667667
return result;
668668
}
669669

670-
/// Checks if [selectionRange] selects [Expression] which can be extracted,
671-
/// and location of this [DartExpression] in AST allows extracting.
670+
/// Checks if [_selectionRange] selects [Expression] which can be extracted,
671+
/// and location of this [Expression] in AST allows extracting.
672672
RefactoringStatus _checkSelection() {
673673
if (_selectionOffset <= 0) {
674674
return RefactoringStatus.fatal(
@@ -784,7 +784,7 @@ final class ExtractMethodRefactoringImpl extends RefactoringImpl
784784
return true;
785785
}
786786

787-
/// If the [selectionRange] is associated with a [FunctionExpression], return
787+
/// If the [_selectionRange] is associated with a [FunctionExpression], return
788788
/// this [FunctionExpression].
789789
FunctionExpression? _findFunctionExpression() {
790790
if (_selectionRange.length != 0) {
@@ -1050,7 +1050,7 @@ final class ExtractMethodRefactoringImpl extends RefactoringImpl
10501050
}
10511051
}
10521052

1053-
/// Checks if the given [element] is declared in [selectionRange].
1053+
/// Checks if the given [element] is declared in [_selectionRange].
10541054
bool _isDeclaredInSelection(Element element) {
10551055
return _selectionRange.contains(element.nameOffset);
10561056
}
@@ -1096,7 +1096,7 @@ final class ExtractMethodRefactoringImpl extends RefactoringImpl
10961096
return false;
10971097
}
10981098

1099-
/// Checks if [element] is referenced after [selectionRange].
1099+
/// Checks if [element] is referenced after [_selectionRange].
11001100
bool _isUsedAfterSelection(Element element) {
11011101
var visitor = _IsUsedAfterSelectionVisitor(this, element);
11021102
_parentMember!.accept(visitor);

pkg/analysis_server/lib/src/services/refactoring/legacy/inline_method.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ class _ParameterOccurrence {
515515
});
516516
}
517517

518-
/// Processor for single [SearchMatch] reference to [methodElement].
518+
/// Processor for single [SearchMatch] reference to an [Element2].
519519
class _ReferenceProcessor {
520520
final InlineMethodRefactoringImpl ref;
521521
final SearchMatch reference;
@@ -915,7 +915,7 @@ class _SourcePart {
915915

916916
/// A visitor that fills [_SourcePart] with fields, parameters and variables.
917917
class _VariablesVisitor extends GeneralizingAstVisitor<void> {
918-
/// The [ExecutableElement] being inlined.
918+
/// The [ExecutableElement2] being inlined.
919919
final ExecutableElement2 methodElement;
920920

921921
/// The [SourceRange] of the element body.

pkg/analysis_server/lib/src/services/refactoring/legacy/refactoring.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ abstract class ExtractLocalRefactoring implements Refactoring {
108108

109109
/// The lengths of the expressions that would be replaced by a reference to
110110
/// the variable. The lengths correspond to the offsets. In other words, for a
111-
/// given expression, if the offset of that expression is offsets[i], then the
112-
/// length of that expression is lengths[i].
111+
/// given expression, if the offset of that expression is `offsets[i]`, then
112+
/// the length of that expression is `lengths[i]`.
113113
List<int> get lengths;
114114

115115
/// The name that the local variable should be given.
@@ -175,8 +175,8 @@ abstract class ExtractMethodRefactoring implements Refactoring {
175175
/// The lengths of the expressions or statements that would be replaced by an
176176
/// invocation of the method. The lengths correspond to the offsets.
177177
/// In other words, for a given expression (or block of statements), if the
178-
/// offset of that expression is offsets[i], then the length of that
179-
/// expression is lengths[i].
178+
/// offset of that expression is `offsets[i]`, then the length of that
179+
/// expression is `lengths[i]`.
180180
List<int> get lengths;
181181

182182
/// The name that the method should be given.
@@ -386,7 +386,7 @@ abstract class Refactoring {
386386
/// This check should be quick because it is used often as arguments change.
387387
Future<RefactoringStatus> checkInitialConditions();
388388

389-
/// Returns the [Change] to apply to perform this refactoring.
389+
/// Returns the [SourceChange] to apply to perform this refactoring.
390390
Future<SourceChange> createChange();
391391
}
392392

pkg/analysis_server/lib/src/services/refactoring/legacy/rename_class_member.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ class _RenameClassMemberValidator extends _BaseClassMemberValidator {
475475
return null;
476476
}
477477

478-
/// Fills [elements] with [Element]s to rename.
478+
/// Fills [elements] with [Element2]s to rename.
479479
Future<void> _prepareElements() async {
480480
var element = this.element;
481481
if (element is FieldElement2 || element is MethodElement2) {

pkg/analysis_server/lib/src/services/refactoring/legacy/rename_constructor.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import 'package:analyzer/source/source_range.dart';
1919
import 'package:analyzer/src/generated/java_core.dart';
2020
import 'package:analyzer_plugin/utilities/range_factory.dart';
2121

22-
/// A [Refactoring] for renaming [ConstructorElement]s.
22+
/// A [Refactoring] for renaming [ConstructorElement2]s.
2323
class RenameConstructorRefactoringImpl extends RenameRefactoringImpl {
2424
RenameConstructorRefactoringImpl(
2525
super.workspace,

pkg/analysis_server/lib/src/services/refactoring/legacy/rename_extension_member.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import 'package:analyzer/source/source_range.dart';
1919
import 'package:analyzer/src/dart/analysis/session_helper.dart';
2020
import 'package:analyzer/src/generated/java_core.dart';
2121

22-
/// A [Refactoring] for renaming extension member [Element]s.
22+
/// A [Refactoring] for renaming extension member [Element2]s.
2323
class RenameExtensionMemberRefactoringImpl extends RenameRefactoringImpl {
2424
final ExtensionElement2 extensionElement;
2525

@@ -92,7 +92,7 @@ class RenameExtensionMemberRefactoringImpl extends RenameRefactoringImpl {
9292
}
9393
}
9494

95-
/// Helper to check if the created or renamed [Element] will cause any
95+
/// Helper to check if the created or renamed [Element2] will cause any
9696
/// conflicts.
9797
class _ExtensionMemberValidator {
9898
final SearchEngine searchEngine;

pkg/analysis_server/lib/src/services/refactoring/legacy/rename_label.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import 'package:analysis_server/src/services/refactoring/legacy/refactoring.dart
88
import 'package:analysis_server/src/services/refactoring/legacy/rename.dart';
99
import 'package:analyzer/dart/element/element2.dart';
1010

11-
/// A [Refactoring] for renaming [LabelElement]s.
11+
/// A [Refactoring] for renaming [LabelElement2]s.
1212
class RenameLabelRefactoringImpl extends RenameRefactoringImpl {
1313
RenameLabelRefactoringImpl(
1414
super.workspace,

pkg/analysis_server/lib/src/services/refactoring/legacy/rename_library.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import 'package:analysis_server/src/services/refactoring/legacy/refactoring.dart
88
import 'package:analysis_server/src/services/refactoring/legacy/rename.dart';
99
import 'package:analyzer/dart/element/element2.dart';
1010

11-
/// A [Refactoring] for renaming [LibraryElement]s.
11+
/// A [Refactoring] for renaming [LibraryElement2]s.
1212
class RenameLibraryRefactoringImpl extends RenameRefactoringImpl {
1313
RenameLibraryRefactoringImpl(
1414
super.workspace,

pkg/analysis_server/lib/src/services/refactoring/legacy/rename_local.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ class ConflictValidatorVisitor extends RecursiveAstVisitor<void> {
115115
}
116116
}
117117

118-
/// A [Refactoring] for renaming [LocalElement]s (excluding [ParameterElement]).
118+
/// A [Refactoring] for renaming [LocalElement2]s (excluding
119+
/// [FormalParameterElement]s).
119120
class RenameLocalRefactoringImpl extends RenameRefactoringImpl {
120121
RenameLocalRefactoringImpl(
121122
super.workspace,

0 commit comments

Comments
 (0)