diff --git a/pkg/analysis_server/lib/src/services/refactoring/legacy/extract_local.dart b/pkg/analysis_server/lib/src/services/refactoring/legacy/extract_local.dart index ef584a651c46..fc8192902ec2 100644 --- a/pkg/analysis_server/lib/src/services/refactoring/legacy/extract_local.dart +++ b/pkg/analysis_server/lib/src/services/refactoring/legacy/extract_local.dart @@ -391,7 +391,7 @@ class ExtractLocalRefactoringImpl extends RefactoringImpl ); } - /// Return an unique identifier for the given [Element], or `null` if + /// Return an unique identifier for the given [Element2], or `null` if /// [element] is `null`. int? _encodeElement(Element2? element) { if (element == null) { @@ -405,8 +405,9 @@ class ExtractLocalRefactoringImpl extends RefactoringImpl return id; } - /// Returns an [Element]-sensitive encoding of [tokens]. - /// Each [Token] with a [LocalVariableElement] has a suffix of the element id. + /// Returns an [Element2]-sensitive encoding of [tokens]. + /// Each [Token] with a [LocalVariableElement2] has a suffix of the element + /// ID. /// /// So, we can distinguish different local variables with the same name, if /// there are multiple variables with the same name are declared in the diff --git a/pkg/analysis_server/lib/src/services/refactoring/legacy/extract_method.dart b/pkg/analysis_server/lib/src/services/refactoring/legacy/extract_method.dart index dc205e6a2487..5ab49b9ebb31 100644 --- a/pkg/analysis_server/lib/src/services/refactoring/legacy/extract_method.dart +++ b/pkg/analysis_server/lib/src/services/refactoring/legacy/extract_method.dart @@ -43,7 +43,7 @@ import 'package:meta/meta.dart'; const String _tokenSeparator = '\uFFFF'; /// Adds edits to the given [change] that ensure that all the [libraries] are -/// imported into the given [targetLibrary]. +/// imported into the given [targetLibrary2]. @visibleForTesting Future addLibraryImports( AnalysisSession session, @@ -667,8 +667,8 @@ final class ExtractMethodRefactoringImpl extends RefactoringImpl return result; } - /// Checks if [selectionRange] selects [Expression] which can be extracted, - /// and location of this [DartExpression] in AST allows extracting. + /// Checks if [_selectionRange] selects [Expression] which can be extracted, + /// and location of this [Expression] in AST allows extracting. RefactoringStatus _checkSelection() { if (_selectionOffset <= 0) { return RefactoringStatus.fatal( @@ -784,7 +784,7 @@ final class ExtractMethodRefactoringImpl extends RefactoringImpl return true; } - /// If the [selectionRange] is associated with a [FunctionExpression], return + /// If the [_selectionRange] is associated with a [FunctionExpression], return /// this [FunctionExpression]. FunctionExpression? _findFunctionExpression() { if (_selectionRange.length != 0) { @@ -1050,7 +1050,7 @@ final class ExtractMethodRefactoringImpl extends RefactoringImpl } } - /// Checks if the given [element] is declared in [selectionRange]. + /// Checks if the given [element] is declared in [_selectionRange]. bool _isDeclaredInSelection(Element element) { return _selectionRange.contains(element.nameOffset); } @@ -1096,7 +1096,7 @@ final class ExtractMethodRefactoringImpl extends RefactoringImpl return false; } - /// Checks if [element] is referenced after [selectionRange]. + /// Checks if [element] is referenced after [_selectionRange]. bool _isUsedAfterSelection(Element element) { var visitor = _IsUsedAfterSelectionVisitor(this, element); _parentMember!.accept(visitor); diff --git a/pkg/analysis_server/lib/src/services/refactoring/legacy/inline_method.dart b/pkg/analysis_server/lib/src/services/refactoring/legacy/inline_method.dart index 662caebe2839..5ffd84f2f71f 100644 --- a/pkg/analysis_server/lib/src/services/refactoring/legacy/inline_method.dart +++ b/pkg/analysis_server/lib/src/services/refactoring/legacy/inline_method.dart @@ -515,7 +515,7 @@ class _ParameterOccurrence { }); } -/// Processor for single [SearchMatch] reference to [methodElement]. +/// Processor for single [SearchMatch] reference to an [Element2]. class _ReferenceProcessor { final InlineMethodRefactoringImpl ref; final SearchMatch reference; @@ -915,7 +915,7 @@ class _SourcePart { /// A visitor that fills [_SourcePart] with fields, parameters and variables. class _VariablesVisitor extends GeneralizingAstVisitor { - /// The [ExecutableElement] being inlined. + /// The [ExecutableElement2] being inlined. final ExecutableElement2 methodElement; /// The [SourceRange] of the element body. diff --git a/pkg/analysis_server/lib/src/services/refactoring/legacy/refactoring.dart b/pkg/analysis_server/lib/src/services/refactoring/legacy/refactoring.dart index 87878058ff9b..513c921b0d89 100644 --- a/pkg/analysis_server/lib/src/services/refactoring/legacy/refactoring.dart +++ b/pkg/analysis_server/lib/src/services/refactoring/legacy/refactoring.dart @@ -108,8 +108,8 @@ abstract class ExtractLocalRefactoring implements Refactoring { /// The lengths of the expressions that would be replaced by a reference to /// the variable. The lengths correspond to the offsets. In other words, for a - /// given expression, if the offset of that expression is offsets[i], then the - /// length of that expression is lengths[i]. + /// given expression, if the offset of that expression is `offsets[i]`, then + /// the length of that expression is `lengths[i]`. List get lengths; /// The name that the local variable should be given. @@ -175,8 +175,8 @@ abstract class ExtractMethodRefactoring implements Refactoring { /// The lengths of the expressions or statements that would be replaced by an /// invocation of the method. The lengths correspond to the offsets. /// In other words, for a given expression (or block of statements), if the - /// offset of that expression is offsets[i], then the length of that - /// expression is lengths[i]. + /// offset of that expression is `offsets[i]`, then the length of that + /// expression is `lengths[i]`. List get lengths; /// The name that the method should be given. @@ -386,7 +386,7 @@ abstract class Refactoring { /// This check should be quick because it is used often as arguments change. Future checkInitialConditions(); - /// Returns the [Change] to apply to perform this refactoring. + /// Returns the [SourceChange] to apply to perform this refactoring. Future createChange(); } diff --git a/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_class_member.dart b/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_class_member.dart index 54cb8dcc42de..d5388ba81bb6 100644 --- a/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_class_member.dart +++ b/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_class_member.dart @@ -475,7 +475,7 @@ class _RenameClassMemberValidator extends _BaseClassMemberValidator { return null; } - /// Fills [elements] with [Element]s to rename. + /// Fills [elements] with [Element2]s to rename. Future _prepareElements() async { var element = this.element; if (element is FieldElement2 || element is MethodElement2) { diff --git a/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_constructor.dart b/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_constructor.dart index 184f4f414f64..47ccefbdbf7b 100644 --- a/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_constructor.dart +++ b/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_constructor.dart @@ -19,7 +19,7 @@ import 'package:analyzer/source/source_range.dart'; import 'package:analyzer/src/generated/java_core.dart'; import 'package:analyzer_plugin/utilities/range_factory.dart'; -/// A [Refactoring] for renaming [ConstructorElement]s. +/// A [Refactoring] for renaming [ConstructorElement2]s. class RenameConstructorRefactoringImpl extends RenameRefactoringImpl { RenameConstructorRefactoringImpl( super.workspace, diff --git a/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_extension_member.dart b/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_extension_member.dart index ec00b2b75017..dde1545fea37 100644 --- a/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_extension_member.dart +++ b/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_extension_member.dart @@ -19,7 +19,7 @@ import 'package:analyzer/source/source_range.dart'; import 'package:analyzer/src/dart/analysis/session_helper.dart'; import 'package:analyzer/src/generated/java_core.dart'; -/// A [Refactoring] for renaming extension member [Element]s. +/// A [Refactoring] for renaming extension member [Element2]s. class RenameExtensionMemberRefactoringImpl extends RenameRefactoringImpl { final ExtensionElement2 extensionElement; @@ -92,7 +92,7 @@ class RenameExtensionMemberRefactoringImpl extends RenameRefactoringImpl { } } -/// Helper to check if the created or renamed [Element] will cause any +/// Helper to check if the created or renamed [Element2] will cause any /// conflicts. class _ExtensionMemberValidator { final SearchEngine searchEngine; diff --git a/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_label.dart b/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_label.dart index 901448514296..618257823b44 100644 --- a/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_label.dart +++ b/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_label.dart @@ -8,7 +8,7 @@ import 'package:analysis_server/src/services/refactoring/legacy/refactoring.dart import 'package:analysis_server/src/services/refactoring/legacy/rename.dart'; import 'package:analyzer/dart/element/element2.dart'; -/// A [Refactoring] for renaming [LabelElement]s. +/// A [Refactoring] for renaming [LabelElement2]s. class RenameLabelRefactoringImpl extends RenameRefactoringImpl { RenameLabelRefactoringImpl( super.workspace, diff --git a/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_library.dart b/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_library.dart index 526ae4673551..acf4183a800d 100644 --- a/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_library.dart +++ b/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_library.dart @@ -8,7 +8,7 @@ import 'package:analysis_server/src/services/refactoring/legacy/refactoring.dart import 'package:analysis_server/src/services/refactoring/legacy/rename.dart'; import 'package:analyzer/dart/element/element2.dart'; -/// A [Refactoring] for renaming [LibraryElement]s. +/// A [Refactoring] for renaming [LibraryElement2]s. class RenameLibraryRefactoringImpl extends RenameRefactoringImpl { RenameLibraryRefactoringImpl( super.workspace, diff --git a/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_local.dart b/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_local.dart index a4fd78557fdf..36948abce1fa 100644 --- a/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_local.dart +++ b/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_local.dart @@ -115,7 +115,8 @@ class ConflictValidatorVisitor extends RecursiveAstVisitor { } } -/// A [Refactoring] for renaming [LocalElement]s (excluding [ParameterElement]). +/// A [Refactoring] for renaming [LocalElement2]s (excluding +/// [FormalParameterElement]s). class RenameLocalRefactoringImpl extends RenameRefactoringImpl { RenameLocalRefactoringImpl( super.workspace, diff --git a/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_parameter.dart b/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_parameter.dart index 45b89c2e6218..49131a8b0ba1 100644 --- a/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_parameter.dart +++ b/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_parameter.dart @@ -12,7 +12,7 @@ import 'package:analysis_server/src/services/search/hierarchy.dart'; import 'package:analyzer/dart/element/element2.dart'; import 'package:analyzer/src/generated/java_core.dart'; -/// A [Refactoring] for renaming [ParameterElement]s. +/// A [Refactoring] for renaming [FormalParameterElement]s. class RenameParameterRefactoringImpl extends RenameRefactoringImpl { List elements = []; @@ -101,7 +101,7 @@ class RenameParameterRefactoringImpl extends RenameRefactoringImpl { } } - /// Fills [elements] with [Element]s to rename. + /// Fills [elements] with [Element2]s to rename. Future _prepareElements() async { var element = element2; if (element.isNamed) { diff --git a/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_unit_member.dart b/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_unit_member.dart index 866833aaa37d..5b21761af17c 100644 --- a/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_unit_member.dart +++ b/pkg/analysis_server/lib/src/services/refactoring/legacy/rename_unit_member.dart @@ -42,7 +42,7 @@ Future validateRenameTopLevel( return _RenameUnitMemberValidator(searchEngine, element, name).validate(); } -/// A [Refactoring] for renaming compilation unit member [Element]s. +/// A [Refactoring] for renaming compilation unit member [Element2]s. class RenameUnitMemberRefactoringImpl extends RenameRefactoringImpl { final ResolvedUnitResult resolvedUnit; @@ -228,7 +228,7 @@ class _BaseUnitMemberValidator { } /// Validates if an element with the [name] will conflict with another - /// top-level [Element] in the same library. + /// top-level [Element2] in the same library. void _validateWillConflict() { for (var element in library.children2) { if (hasDisplayName(element, name)) { @@ -242,7 +242,7 @@ class _BaseUnitMemberValidator { } } - /// Validates if renamed [element] will shadow any [Element] named [name]. + /// Validates if renamed [element] will shadow any [Element2] named [name]. Future _validateWillShadow(Element2? element) async { var declarations = await searchEngine.searchMemberDeclarations(name); for (var declaration in declarations) { diff --git a/pkg/analysis_server/lib/src/services/refactoring/move_top_level_to_file.dart b/pkg/analysis_server/lib/src/services/refactoring/move_top_level_to_file.dart index 109ae19a3205..e19e60cc581a 100644 --- a/pkg/analysis_server/lib/src/services/refactoring/move_top_level_to_file.dart +++ b/pkg/analysis_server/lib/src/services/refactoring/move_top_level_to_file.dart @@ -442,8 +442,7 @@ class _MembersToMove { /// The members to be moved, in groups of contiguous members. final List<_MemberGroup> groups; - /// Initialize a newly created instance representing the [member] with the - /// given [name]. + /// Initialize a newly created instance representing [groups]. _MembersToMove(this.containingFile, this.groups); /// Return the name that should be used for the file to which the members will @@ -545,7 +544,7 @@ class _SealedSubclassIndex { } extension on CompilationUnitMember { - /// Gets all sealed [ClassElement]s that are superclasses of this member. + /// Gets all sealed [ClassElement2]s that are superclasses of this member. Iterable get sealedSuperclassElements { return superclasses .map((type) => type?.element2)