From 1830689c808a5876cb52718b13a953495af3bc33 Mon Sep 17 00:00:00 2001 From: Sam Rawlins Date: Tue, 7 Jan 2025 08:03:49 -0800 Subject: [PATCH] DAS: Correct comment references in services/ Change-Id: I4d896e4e917311513a725460f95ca5561bc80ec8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403282 Reviewed-by: Brian Wilkerson Commit-Queue: Samuel Rawlins --- pkg/analysis_server/lib/src/legacy_analysis_server.dart | 2 +- .../lib/src/services/correction/bulk_fix_processor.dart | 8 ++++---- .../dart/add_diagnostic_property_reference.dart | 7 ++++--- .../src/services/correction/dart/remove_comparison.dart | 4 ++-- .../correction/fix/data_driven/transform_set_parser.dart | 8 ++++---- .../services/correction/fix/pubspec/fix_generator.dart | 5 ++--- .../lib/src/services/correction/namespace.dart | 2 +- .../lib/src/services/correction/organize_imports.dart | 3 +-- .../lib/src/services/correction/sort_members.dart | 2 +- .../lib/src/services/correction/status.dart | 2 +- pkg/analysis_server/lib/src/services/correction/util.dart | 4 ++-- .../lib/src/services/pub/pub_package_service.dart | 3 +++ 12 files changed, 26 insertions(+), 24 deletions(-) diff --git a/pkg/analysis_server/lib/src/legacy_analysis_server.dart b/pkg/analysis_server/lib/src/legacy_analysis_server.dart index 51fcf2928e9..a2a397f807f 100644 --- a/pkg/analysis_server/lib/src/legacy_analysis_server.dart +++ b/pkg/analysis_server/lib/src/legacy_analysis_server.dart @@ -620,7 +620,7 @@ class LegacyAnalysisServer extends AnalysisServer { ); } - /// Handle a [request] that was read from the communication channel. + /// Handle a [requestOrResponse] that was read from the communication channel. void handleRequestOrResponse(RequestOrResponse requestOrResponse) { if (requestOrResponse is Request) { var cancellationToken = CancelableToken(); diff --git a/pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart b/pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart index fe845e4f1d8..e53e8755f70 100644 --- a/pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart +++ b/pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart @@ -17,7 +17,6 @@ import 'package:analysis_server_plugin/edit/fix/dart_fix_context.dart'; import 'package:analysis_server_plugin/edit/fix/fix.dart'; import 'package:analysis_server_plugin/src/correction/dart_change_workspace.dart'; import 'package:analysis_server_plugin/src/correction/fix_generators.dart'; -import 'package:analysis_server_plugin/src/correction/fix_processor.dart'; import 'package:analyzer/dart/analysis/analysis_context.dart'; import 'package:analyzer/dart/analysis/analysis_options.dart'; import 'package:analyzer/dart/analysis/results.dart'; @@ -80,9 +79,10 @@ class BulkFixProcessor { ]; /// A map from an error code to a list of generators used to create multiple - /// correction producers used to build fixes for those diagnostics. The - /// generators used for lint rules are in the - /// [FixProcessor.lintMultiProducerMap]. + /// correction producers used to build fixes for those diagnostics. + /// + /// The generators used for lint rules are in + /// `_RegisteredFixGenerators.lintMultiProducers`. /// /// The expectation is that only one of the correction producers will produce /// a change for a given fix. If more than one change is produced the result diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_diagnostic_property_reference.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_diagnostic_property_reference.dart index ed747606798..8b303adc15e 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/add_diagnostic_property_reference.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/add_diagnostic_property_reference.dart @@ -215,8 +215,8 @@ class AddDiagnosticPropertyReference extends ResolvedCorrectionProducer { } } - /// Fixes all instances of the [LintNames.diagnostic_describe_all_properties] in the given - /// [declaration]. + /// Fixes all instances of the [LintNames.diagnostic_describe_all_properties] + /// in the given [declaration]. Future _fixAllDiagnosticPropertyReferences( ChangeBuilder builder, ClassDeclaration declaration, @@ -366,7 +366,8 @@ class AddDiagnosticPropertyReference extends ResolvedCorrectionProducer { } /// Returns a list of all the [AnalysisError]s of type - /// [DiagnosticDescribeAllProperties.code] fpr the given [declaration]. + /// [LinterLintCode.diagnostic_describe_all_properties] for the given + /// [declaration]. List _getAllDiagnosticsInClass(ClassDeclaration declaration) { var propertyErrors = []; var startOffset = declaration.offset; diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_comparison.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_comparison.dart index e219b7ef44d..a9d7ec45fe8 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/remove_comparison.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_comparison.dart @@ -188,8 +188,8 @@ class RemoveComparison extends ResolvedCorrectionProducer { } } - /// Use the [builder] to add an edit to delete the operator and given - /// [operand] from the [binary] expression. + /// Adds an edit with [builder] to delete the operator and [node] from the + /// [binary] expression (where [node] is assumed to be one of the operands). Future _removeOperatorAndOperand( ChangeBuilder builder, BinaryExpression binary, diff --git a/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_parser.dart b/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_parser.dart index fa4b5176ae0..0b6dc567035 100644 --- a/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_parser.dart +++ b/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_parser.dart @@ -174,8 +174,8 @@ class TransformSetParser { return _translateTransformSet(node); } - /// Convert the given [template] into a list of components. Variable - /// references in the template are looked up in the map of [generators]. + /// Converts the given [template] into a list of components. Variable + /// references in the template are looked up in [variableScope]. List _extractTemplateComponents( String template, VariableScope variableScope, @@ -301,8 +301,8 @@ class TransformSetParser { return null; } - /// Report that the value represented by the [node] does not have the - /// [expectedType], using the [context] to get the key to use in the message. + /// Reports that the value represented by the [node] is not one of the + /// [allowedValues], using the [context] to get the key to use in the message. Null _reportInvalidValueOneOf( YamlNode node, ErrorContext context, diff --git a/pkg/analysis_server/lib/src/services/correction/fix/pubspec/fix_generator.dart b/pkg/analysis_server/lib/src/services/correction/fix/pubspec/fix_generator.dart index f0d78b10dcc..597fcba090d 100644 --- a/pkg/analysis_server/lib/src/services/correction/fix/pubspec/fix_generator.dart +++ b/pkg/analysis_server/lib/src/services/correction/fix/pubspec/fix_generator.dart @@ -142,9 +142,8 @@ class PubspecFixGenerator { return fixes; } - /// Add a fix whose edits were built by the [builder] that has the given - /// [kind]. If [args] are provided, they will be used to fill in the message - /// for the fix. + /// Adds a fix whose edits were built by the [builder] that has the given + /// [kind]. void _addFixFromBuilder(ChangeBuilder builder, FixKind kind) { var change = builder.sourceChange; if (change.edits.isEmpty) { diff --git a/pkg/analysis_server/lib/src/services/correction/namespace.dart b/pkg/analysis_server/lib/src/services/correction/namespace.dart index 6d0cf3e8e6b..64868b445b7 100644 --- a/pkg/analysis_server/lib/src/services/correction/namespace.dart +++ b/pkg/analysis_server/lib/src/services/correction/namespace.dart @@ -207,7 +207,7 @@ LibraryImportElement? _getImportElementInfo(SimpleIdentifier prefixNode) { return _getImportElement(libraryElement, prefix, usedElement); } -/// Returns the [LibraryImport2] that is referenced by [prefixNode] with a +/// Returns the [LibraryImport] that is referenced by [prefixNode] with a /// [PrefixElement], maybe `null`. LibraryImport? _getImportElementInfo2(SimpleIdentifier prefixNode) { // prepare environment diff --git a/pkg/analysis_server/lib/src/services/correction/organize_imports.dart b/pkg/analysis_server/lib/src/services/correction/organize_imports.dart index aa8d2384873..b1bd6662b69 100644 --- a/pkg/analysis_server/lib/src/services/correction/organize_imports.dart +++ b/pkg/analysis_server/lib/src/services/correction/organize_imports.dart @@ -18,8 +18,7 @@ import 'package:analyzer_plugin/protocol/protocol_common.dart' import 'package:analyzer_plugin/src/utilities/directive_sort.dart'; import 'package:meta/meta_meta.dart'; -/// Organizes imports (and other directives) in the [unit], using sorting -/// rules from [DirectiveSorter]. +/// Organizes imports (and other directives) in the [unit]. class ImportOrganizer { final String initialCode; diff --git a/pkg/analysis_server/lib/src/services/correction/sort_members.dart b/pkg/analysis_server/lib/src/services/correction/sort_members.dart index cdf92f549a0..7766005af29 100644 --- a/pkg/analysis_server/lib/src/services/correction/sort_members.dart +++ b/pkg/analysis_server/lib/src/services/correction/sort_members.dart @@ -107,7 +107,7 @@ class MemberSorter { } } - /// Sorts all members of the given [classDeclaration]. + /// Sorts the [membersToSort]. void _sortClassMembers(List membersToSort) { var members = <_MemberInfo>[]; for (var member in membersToSort) { diff --git a/pkg/analysis_server/lib/src/services/correction/status.dart b/pkg/analysis_server/lib/src/services/correction/status.dart index c86f120567e..18b94d01814 100644 --- a/pkg/analysis_server/lib/src/services/correction/status.dart +++ b/pkg/analysis_server/lib/src/services/correction/status.dart @@ -7,7 +7,7 @@ import 'package:analyzer_plugin/protocol/protocol_common.dart'; /// An outcome of a condition checking operation. class RefactoringStatus { /// The current severity of this [RefactoringStatus] - the maximum of the - /// severities of its [entries]. + /// severities of its [problems]. RefactoringProblemSeverity? _severity; /// A list of [RefactoringProblem]s. diff --git a/pkg/analysis_server/lib/src/services/correction/util.dart b/pkg/analysis_server/lib/src/services/correction/util.dart index 2d50d17731a..886d4fdef61 100644 --- a/pkg/analysis_server/lib/src/services/correction/util.dart +++ b/pkg/analysis_server/lib/src/services/correction/util.dart @@ -329,8 +329,8 @@ bool isDeclaredIn(AstNode root, String name) { return collector.isDeclared; } -/// Checks if given [DartNode] is the left hand side of an assignment, or a -/// declaration of a variable. +/// Returns whether the given [node] is the left hand side of an assignment, or +/// a declaration of a variable. bool isLeftHandOfAssignment(SimpleIdentifier node) { if (node.inSetterContext()) { return true; diff --git a/pkg/analysis_server/lib/src/services/pub/pub_package_service.dart b/pkg/analysis_server/lib/src/services/pub/pub_package_service.dart index 3385c717283..d8c2299119e 100644 --- a/pkg/analysis_server/lib/src/services/pub/pub_package_service.dart +++ b/pkg/analysis_server/lib/src/services/pub/pub_package_service.dart @@ -2,6 +2,9 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +/// @docImport 'package:analyzer/file_system/physical_file_system.dart'; +library; + import 'dart:async'; import 'dart:convert';