From 9bea89246aadcdd7442498228219e786bf18eb25 Mon Sep 17 00:00:00 2001 From: Ahmed Ashour Date: Mon, 21 Nov 2022 20:07:29 +0000 Subject: [PATCH] Fix grammar Fixes #50509 TEST=ci Change-Id: I7ca115bbe6f436e9df126afddcc08eaba79af2f3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270740 Commit-Queue: Sigmund Cherem Reviewed-by: Lasse Nielsen Reviewed-by: Derek Xu Reviewed-by: Sigmund Cherem --- .../completion/dart/suggestion_builder.dart | 2 +- pkg/analyzer/lib/dart/element/element.dart | 4 ++-- .../lib/src/dart/analysis/driver.dart | 2 +- .../lib/src/dart/analysis/file_state.dart | 2 +- .../lib/src/summary2/bundle_reader.dart | 2 +- .../performance/operation_performance.dart | 2 +- pkg/compiler/lib/src/compiler.dart | 2 +- .../src/deferred_load/algorithm_state.dart | 2 +- .../lib/src/js_backend/annotations.dart | 2 +- pkg/compiler/lib/src/ordered_typeset.dart | 2 +- .../fasta/kernel/expression_generator.dart | 20 +++++++++---------- .../lib/src/dart_io_extensions.dart | 15 ++++++++------ .../frontend/kernel_binary_flowgraph.cc | 2 +- runtime/vm/compiler/frontend/scope_builder.cc | 2 +- .../ffi/resource_management/utf8_helpers.dart | 2 +- sdk/lib/_http/http.dart | 8 ++++---- sdk/lib/_http/websocket.dart | 2 +- sdk/lib/html/dart2js/html_dart2js.dart | 2 +- tools/dom/docs.json | 2 +- 19 files changed, 40 insertions(+), 37 deletions(-) diff --git a/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart b/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart index 6badb53e6f5..0ff4d130b65 100644 --- a/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart +++ b/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart @@ -581,7 +581,7 @@ class SuggestionBuilder { ); } - /// Add a suggestion for a [element]. If the class can only be + /// Add a suggestion for an [element]. If the class can only be /// referenced using a prefix, then the [prefix] should be provided. void suggestInterface(InterfaceElement element, {String? prefix}) { var relevance = _computeTopLevelRelevance(element, diff --git a/pkg/analyzer/lib/dart/element/element.dart b/pkg/analyzer/lib/dart/element/element.dart index ee72bf2466e..d00aa850cbe 100644 --- a/pkg/analyzer/lib/dart/element/element.dart +++ b/pkg/analyzer/lib/dart/element/element.dart @@ -80,7 +80,7 @@ abstract class AugmentationImportElement implements _ExistingElement { /// Clients may not extend, implement or mix-in this class. abstract class AugmentedClassElement implements AugmentedInterfaceElement {} -/// The result of applying augmentations to a [EnumElement]. +/// The result of applying augmentations to an [EnumElement]. /// /// Clients may not extend, implement or mix-in this class. abstract class AugmentedEnumElement implements AugmentedInterfaceElement {} @@ -1092,7 +1092,7 @@ abstract class ElementVisitor { abstract class EnumAugmentationElement implements EnumOrAugmentationElement { /// Returns the element that is augmented by this augmentation; or `null` if /// there is no corresponding element to be augmented. The chain of - /// augmentations should normally end with a [EnumElement], but might end + /// augmentations should normally end with an [EnumElement], but might end /// with `null` immediately or after a few intermediate /// [EnumAugmentationElement]s in case of invalid code when an augmentation /// is declared without the corresponding enum declaration. diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart index 32ec0459ebe..9277bb66a1f 100644 --- a/pkg/analyzer/lib/src/dart/analysis/driver.dart +++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart @@ -252,7 +252,7 @@ class AnalysisDriver implements AnalysisDriverGeneric { /// Create a new instance of [AnalysisDriver]. /// /// The given [SourceFactory] is cloned to ensure that it does not contain a - /// reference to a [AnalysisContext] in which it could have been used. + /// reference to an [AnalysisContext] in which it could have been used. AnalysisDriver({ required AnalysisDriverScheduler scheduler, required PerformanceLog logger, diff --git a/pkg/analyzer/lib/src/dart/analysis/file_state.dart b/pkg/analyzer/lib/src/dart/analysis/file_state.dart index 346739d2340..ff53c6f4741 100644 --- a/pkg/analyzer/lib/src/dart/analysis/file_state.dart +++ b/pkg/analyzer/lib/src/dart/analysis/file_state.dart @@ -92,7 +92,7 @@ class AugmentationImportWithFile importedFile.referencingFiles.add(container.file); } - /// If [importedFile] is a [AugmentationFileKind], and it confirms that + /// If [importedFile] is an [AugmentationFileKind], and it confirms that /// it is an augmentation of the [container], returns the [importedFile]. AugmentationFileKind? get importedAugmentation { final kind = importedFile.kind; diff --git a/pkg/analyzer/lib/src/summary2/bundle_reader.dart b/pkg/analyzer/lib/src/summary2/bundle_reader.dart index 10f851d40aa..f6bc15be0c0 100644 --- a/pkg/analyzer/lib/src/summary2/bundle_reader.dart +++ b/pkg/analyzer/lib/src/summary2/bundle_reader.dart @@ -355,7 +355,7 @@ class FunctionElementLinkedData extends ElementLinkedData { } } -/// Not a [ElementLinkedData], just a bundle with data. +/// Not an [ElementLinkedData], just a bundle with data. class LibraryAugmentationElementLinkedData { final int offset; ApplyConstantOffsets? applyConstantOffsets; diff --git a/pkg/analyzer/lib/src/util/performance/operation_performance.dart b/pkg/analyzer/lib/src/util/performance/operation_performance.dart index 7c510eb4343..aa9dba0c5ce 100644 --- a/pkg/analyzer/lib/src/util/performance/operation_performance.dart +++ b/pkg/analyzer/lib/src/util/performance/operation_performance.dart @@ -31,7 +31,7 @@ abstract class OperationPerformance { }); } -/// The data attachment for a [OperationPerformance]. +/// The data attachment for an [OperationPerformance]. abstract class OperationPerformanceData { String get name; diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart index 0d378336f72..6ccd5b09645 100644 --- a/pkg/compiler/lib/src/compiler.dart +++ b/pkg/compiler/lib/src/compiler.dart @@ -77,7 +77,7 @@ import 'universe/resolution_world_builder.dart'; import 'universe/world_impact.dart' show WorldImpact, WorldImpactBuilderImpl; import 'compiler_migrated.dart'; -/// Implementation of the compiler using a [api.CompilerInput] for supplying +/// Implementation of the compiler using a [api.CompilerInput] for supplying /// the sources. class Compiler implements diff --git a/pkg/compiler/lib/src/deferred_load/algorithm_state.dart b/pkg/compiler/lib/src/deferred_load/algorithm_state.dart index 8ec7d77debf..4365f186057 100644 --- a/pkg/compiler/lib/src/deferred_load/algorithm_state.dart +++ b/pkg/compiler/lib/src/deferred_load/algorithm_state.dart @@ -33,7 +33,7 @@ class AlgorithmState { this.importSets, this.registry) : queue = WorkQueue(importSets, registry); - /// Factory function to create and initialize a [AlgorithmState]. + /// Factory function to create and initialize an [AlgorithmState]. factory AlgorithmState.create( FunctionEntity main, Compiler compiler, diff --git a/pkg/compiler/lib/src/js_backend/annotations.dart b/pkg/compiler/lib/src/js_backend/annotations.dart index 10511d522f4..7b31627fc43 100644 --- a/pkg/compiler/lib/src/js_backend/annotations.dart +++ b/pkg/compiler/lib/src/js_backend/annotations.dart @@ -306,7 +306,7 @@ EnumSet processMemberAnnotations( } abstract class AnnotationsData { - /// Deserializes a [AnnotationsData] object from [source]. + /// Deserializes an [AnnotationsData] object from [source]. factory AnnotationsData.readFromDataSource( CompilerOptions options, DiagnosticReporter reporter, diff --git a/pkg/compiler/lib/src/ordered_typeset.dart b/pkg/compiler/lib/src/ordered_typeset.dart index ac2f4a7bd14..4cbea4230d8 100644 --- a/pkg/compiler/lib/src/ordered_typeset.dart +++ b/pkg/compiler/lib/src/ordered_typeset.dart @@ -37,7 +37,7 @@ class OrderedTypeSet { OrderedTypeSet._(this._levels, this.types); - /// Deserializes a [OrderedTypeSet] object from [source]. + /// Deserializes an [OrderedTypeSet] object from [source]. factory OrderedTypeSet.readFromDataSource(DataSourceReader source) { // TODO(johnniwinther): Make the deserialized type sets share their // internal links like the original type sets do? diff --git a/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart b/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart index bd42ad7af88..1b82537e2e3 100644 --- a/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart +++ b/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart @@ -98,20 +98,20 @@ abstract class Generator { /// The source uri for use in error messaging. Uri get _uri => _helper.uri; - /// Builds a [Expression] representing a read from the generator. + /// Builds an [Expression] representing a read from the generator. /// /// The read of this subexpression does _not_ need to support a simultaneous /// write of the same subexpression. Expression buildSimpleRead(); - /// Builds a [Expression] representing an assignment with the generator on + /// Builds an [Expression] representing an assignment with the generator on /// the LHS and [value] on the RHS. /// /// The returned expression evaluates to the assigned value, unless /// [voidContext] is true, in which case it may evaluate to anything. Expression buildAssignment(Expression value, {bool voidContext = false}); - /// Returns a [Expression] representing a null-aware assignment (`??=`) with + /// Returns an [Expression] representing a null-aware assignment (`??=`) with /// the generator on the LHS and [value] on the RHS. /// /// The returned expression evaluates to the assigned value, unless @@ -121,7 +121,7 @@ abstract class Generator { Expression buildIfNullAssignment(Expression value, DartType type, int offset, {bool voidContext = false}); - /// Returns a [Expression] representing a compound assignment (e.g. `+=`) + /// Returns an [Expression] representing a compound assignment (e.g. `+=`) /// with the generator on the LHS and [value] on the RHS. Expression buildCompoundAssignment(Name binaryOperator, Expression value, {int offset = TreeNode.noOffset, @@ -129,7 +129,7 @@ abstract class Generator { bool isPreIncDec = false, bool isPostIncDec = false}); - /// Returns a [Expression] representing a pre-increment or pre-decrement of + /// Returns an [Expression] representing a pre-increment or pre-decrement of /// the generator. Expression buildPrefixIncrement(Name binaryOperator, {int offset = TreeNode.noOffset, bool voidContext = false}) { @@ -143,7 +143,7 @@ abstract class Generator { isPreIncDec: true); } - /// Returns a [Expression] representing a post-increment or post-decrement of + /// Returns an [Expression] representing a post-increment or post-decrement of /// the generator. Expression buildPostfixIncrement(Name binaryOperator, {int offset = TreeNode.noOffset, bool voidContext = false}); @@ -154,7 +154,7 @@ abstract class Generator { Generator buildIndexedAccess(Expression index, Token token, {required bool isNullAware}); - /// Returns a [Expression] representing a compile-time error. + /// Returns an [Expression] representing a compile-time error. /// /// At runtime, an exception will be thrown. Expression _makeInvalidRead(UnresolvedKind unresolvedKind) { @@ -162,7 +162,7 @@ abstract class Generator { kind: unresolvedKind); } - /// Returns a [Expression] representing a compile-time error wrapping + /// Returns an [Expression] representing a compile-time error wrapping /// [value]. /// /// At runtime, [value] will be evaluated before throwing an exception. @@ -1844,7 +1844,7 @@ class ExtensionInstanceAccessGenerator extends Generator { } } -/// A [ExplicitExtensionInstanceAccessGenerator] represents a subexpression +/// An [ExplicitExtensionInstanceAccessGenerator] represents a subexpression /// whose prefix is a forced extension instance member access. /// /// For instance @@ -2556,7 +2556,7 @@ class ExplicitExtensionIndexedAccessGenerator extends Generator { } } -/// A [ExplicitExtensionAccessGenerator] represents a subexpression whose +/// An [ExplicitExtensionAccessGenerator] represents a subexpression whose /// prefix is an explicit extension application. /// /// For instance diff --git a/pkg/vm_service/lib/src/dart_io_extensions.dart b/pkg/vm_service/lib/src/dart_io_extensions.dart index 8760a4d3fa6..a33ff29e0bb 100644 --- a/pkg/vm_service/lib/src/dart_io_extensions.dart +++ b/pkg/vm_service/lib/src/dart_io_extensions.dart @@ -290,8 +290,8 @@ abstract class _State extends Response { final String _type; } -/// A [HttpTimelineLoggingState] provides information about the current state of HTTP -/// request logging for a given isolate. +/// An [HttpTimelineLoggingState] provides information about the current state +/// of HTTP request logging for a given isolate. class HttpTimelineLoggingState extends _State { static HttpTimelineLoggingState? parse(Map? json) => json == null ? null : HttpTimelineLoggingState._fromJson(json); @@ -499,7 +499,8 @@ class HttpProfileRequestData { /// Returns `true` if an error has occurred while issuing the request. /// - /// If `true`, attempting to access some fields will throw a [HttpProfileRequestError]. + /// If `true`, attempting to access some fields will throw an + /// [HttpProfileRequestError]. bool get hasError => error != null; /// Information about the client connection. @@ -586,7 +587,7 @@ class HttpProfileRequestError implements Error { String toString() => 'HttpProfileRequestError: $error.'; } -/// Proxy authentication details associated with a [HttpProfileRequest]. +/// Proxy authentication details associated with an [HttpProfileRequest]. class HttpProfileProxyData { static HttpProfileProxyData? parse(Map? json) => json == null ? null : HttpProfileProxyData._fromJson(json); @@ -738,7 +739,8 @@ class SocketProfilingState extends _State { : super._fromJson(json); } -/// A [SpawnedProcessRef] contains identifying information about a spawned process. +/// A [SpawnedProcessRef] contains identifying information about a spawned +/// process. class SpawnedProcessRef { static SpawnedProcessRef? parse(Map? json) => json == null ? null : SpawnedProcessRef._fromJson(json); @@ -836,7 +838,8 @@ class SpawnedProcessList extends Response { final List _processes; } -/// A [OpenFileRef] contains identifying information about a currently opened file. +/// An [OpenFileRef] contains identifying information about a currently opened +/// file. class OpenFileRef { static OpenFileRef? parse(Map? json) => json == null ? null : OpenFileRef._fromJson(json); diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc index a2377f664a4..d1e030c784d 100644 --- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc +++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc @@ -894,7 +894,7 @@ FlowGraph* StreamingFlowGraphBuilder::BuildGraph() { const Function& function = parsed_function()->function(); - // Setup a [ActiveClassScope] and a [ActiveMemberScope] which will be used + // Setup an [ActiveClassScope] and an [ActiveMemberScope] which will be used // e.g. for type translation. const Class& klass = Class::Handle(zone_, parsed_function()->function().Owner()); diff --git a/runtime/vm/compiler/frontend/scope_builder.cc b/runtime/vm/compiler/frontend/scope_builder.cc index 1c3206913b6..eb431f944a4 100644 --- a/runtime/vm/compiler/frontend/scope_builder.cc +++ b/runtime/vm/compiler/frontend/scope_builder.cc @@ -52,7 +52,7 @@ ScopeBuildingResult* ScopeBuilder::BuildScopes() { const Function& function = parsed_function_->function(); - // Setup a [ActiveClassScope] and a [ActiveMemberScope] which will be used + // Setup an [ActiveClassScope] and an [ActiveMemberScope] which will be used // e.g. for type translation. const Class& klass = Class::Handle(Z, function.Owner()); diff --git a/samples/ffi/resource_management/utf8_helpers.dart b/samples/ffi/resource_management/utf8_helpers.dart index 4ef8a4568c1..09dddc130f7 100644 --- a/samples/ffi/resource_management/utf8_helpers.dart +++ b/samples/ffi/resource_management/utf8_helpers.dart @@ -14,7 +14,7 @@ extension Utf8InArena on String { /// If 'string' contains NULL bytes, the converted string will be truncated /// prematurely. See [Utf8Encoder] for details on encoding. /// - /// Returns a [allocator]-allocated pointer to the result. + /// Returns an [allocator]-allocated pointer to the result. Pointer toUtf8(Allocator allocator) { final units = utf8.encode(this); final Pointer result = allocator(units.length + 1); diff --git a/sdk/lib/_http/http.dart b/sdk/lib/_http/http.dart index 938a4b30d7a..b6311f13c59 100644 --- a/sdk/lib/_http/http.dart +++ b/sdk/lib/_http/http.dart @@ -269,7 +269,7 @@ abstract class HttpServer implements Stream { /// The default timeout is 20 minutes. set sessionTimeout(int timeout); - /// A [HttpConnectionsInfo] object summarizing the number of + /// An [HttpConnectionsInfo] object summarizing the number of /// current connections handled by the server. HttpConnectionsInfo connectionsInfo(); } @@ -1070,7 +1070,7 @@ abstract class HttpResponse implements IOSink { /// ## Making a simple GET request: an example /// /// A `getUrl` request is a two-step process, triggered by two [Future]s. -/// When the first future completes with a [HttpClientRequest], the underlying +/// When the first future completes with an [HttpClientRequest], the underlying /// network connection has been established, but no data has been sent. /// In the callback function for the first future, the HTTP headers and body /// can be set on the request. Either the first write to the request object @@ -1723,7 +1723,7 @@ abstract class HttpClientRequest implements IOSink { /// Cookies to present to the server (in the 'cookie' header). List get cookies; - /// A [HttpClientResponse] future that will complete once the response is + /// An [HttpClientResponse] future that will complete once the response is /// available. /// /// If an error occurs before the response is available, this future will @@ -1770,7 +1770,7 @@ abstract class HttpClientRequest implements IOSink { /// HTTP response for a client connection. /// -/// The body of a [HttpClientResponse] object is a [Stream] of data from the +/// The body of an [HttpClientResponse] object is a [Stream] of data from the /// server. Use [Stream] methods like [`transform`][Stream.transform] and /// [`join`][Stream.join] to access the data. /// diff --git a/sdk/lib/_http/websocket.dart b/sdk/lib/_http/websocket.dart index a01823c3753..4ef5b08e13a 100644 --- a/sdk/lib/_http/websocket.dart +++ b/sdk/lib/_http/websocket.dart @@ -227,7 +227,7 @@ abstract class WebSocketTransformer return _WebSocketTransformerImpl(protocolSelector, compression); } - /// Upgrades a [HttpRequest] to a [WebSocket] connection. If the + /// Upgrades an [HttpRequest] to a [WebSocket] connection. If the /// request is not a valid WebSocket upgrade request an HTTP response /// with status code 500 will be returned. Otherwise the returned /// future will complete with the [WebSocket] when the upgrade process diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart index 06db27b4b1c..6416e8a1459 100644 --- a/sdk/lib/html/dart2js/html_dart2js.dart +++ b/sdk/lib/html/dart2js/html_dart2js.dart @@ -18599,7 +18599,7 @@ class HttpRequest extends HttpRequestEventTarget { * Length of time in milliseconds before a request is automatically * terminated. * - * When the time has passed, a [HttpRequestEventTarget.timeoutEvent] is + * When the time has passed, an [HttpRequestEventTarget.timeoutEvent] is * dispatched. * * If [timeout] is set to 0, then the request will not time out. diff --git a/tools/dom/docs.json b/tools/dom/docs.json index 51334c0b07e..45bd2a4f9be 100644 --- a/tools/dom/docs.json +++ b/tools/dom/docs.json @@ -4384,7 +4384,7 @@ " * Length of time in milliseconds before a request is automatically", " * terminated.", " *", - " * When the time has passed, a [HttpRequestEventTarget.timeoutEvent] is", + " * When the time has passed, an [HttpRequestEventTarget.timeoutEvent] is", " * dispatched.", " *", " * If [timeout] is set to 0, then the request will not time out.",