Skip to content

Commit a546836

Browse files
scheglovCommit Queue
authored andcommitted
CQ. Remove unnecessary 'async' where no 'await'.
Change-Id: I58f56c098c9cec753325ab56d0aad37e1fde0ec6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403082 Reviewed-by: Samuel Rawlins <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 9b9f7c2 commit a546836

File tree

63 files changed

+119
-124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+119
-124
lines changed

pkg/analysis_server/benchmark/integration/driver.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class Driver extends IntegrationTest {
7070
/// Launch the analysis server.
7171
///
7272
/// Return a [Future] that completes when analysis server has started.
73-
Future<void> startServer() async {
73+
Future<void> startServer() {
7474
logger.log(Level.FINE, 'starting server');
7575
server = Server();
7676
var serverConnected = Completer<void>();

pkg/analysis_server/lib/src/cider/completion.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ class CiderCompletionComputer {
5555
required int column,
5656
@visibleForTesting
5757
void Function(ResolvedForCompletionResultImpl)? testResolvedUnit,
58-
}) async {
58+
}) {
5959
return _performanceRoot.runAsync('completion', (performance) async {
6060
var resolvedUnit = await performance.runAsync('resolution', (
6161
performance,
62-
) async {
62+
) {
6363
return _fileResolver.resolveForCompletion(
6464
completionLine: line,
6565
completionColumn: column,

pkg/analysis_server/lib/src/context_manager.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ class ContextManagerImpl implements ContextManager {
553553
/// rebuild will occur only once it has exited.
554554
///
555555
/// Returns a [Future] that completes once the requested rebuild completes.
556-
Future<void> _createAnalysisContexts() async {
556+
Future<void> _createAnalysisContexts() {
557557
/// A helper that performs a context rebuild while monitoring the included
558558
/// paths for changes until the contexts file watchers are ready.
559559
///

pkg/analysis_server/lib/src/lsp/handlers/handler_code_actions.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class CodeActionHandler
3939
CodeActionParams params,
4040
MessageInfo message,
4141
CancellationToken token,
42-
) async {
42+
) {
4343
var performance = message.performance;
4444

4545
var textDocument = params.textDocument;

pkg/analysis_server/lib/src/lsp/handlers/handler_semantic_tokens.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ abstract class AbstractSemanticTokensHandler<T>
5858
TextDocumentIdentifier textDocument,
5959
CancellationToken token, {
6060
Range? range,
61-
}) async {
61+
}) {
6262
var path = pathOfDoc(textDocument);
6363

6464
return path.mapResult((path) async {

pkg/analysis_server/lib/src/lsp/temporary_overlay_operation.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ abstract class TemporaryOverlayOperation {
8686
/// temporary overlays and re-enabled after the overlays are restored.
8787
Future<T> lockRequestsWithTemporaryOverlays<T>(
8888
Future<T> Function() operation,
89-
) async {
89+
) {
9090
return server.lockRequestsWhile(() async {
9191
// Wait for any in-progress analysis to complete before we start
9292
// suppressing analysis results.

pkg/analysis_server/lib/src/search/element_references.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ class ElementReferencesComputer {
6868
}
6969

7070
/// Returns a [Future] completing with a [List] of references to [element].
71-
Future<List<SearchMatch>> _findSingleElementReferences(
72-
Element2 element,
73-
) async {
71+
Future<List<SearchMatch>> _findSingleElementReferences(Element2 element) {
7472
return searchEngine.searchReferences(element);
7573
}
7674

pkg/analysis_server/lib/src/server/driver.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ class Driver implements ServerStarter {
512512

513513
capture(instrumentationService, () {
514514
var stdioServer = LspStdioAnalysisServer(socketServer);
515-
stdioServer.serveStdio().then((_) async {
515+
stdioServer.serveStdio().then((_) {
516516
// Only shutdown the server and exit if the server is not already
517517
// handling the shutdown.
518518
if (!socketServer.analysisServer!.willExit) {

pkg/analysis_server/lib/src/server/http_server.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class HttpAnalysisServer {
9393

9494
/// Attach a listener to a newly created HTTP server.
9595
void _handleServer(HttpServer httpServer) {
96-
httpServer.listen((HttpRequest request) async {
96+
httpServer.listen((HttpRequest request) {
9797
var updateValues = request.headers[HttpHeaders.upgradeHeader];
9898
if (request.method == 'GET') {
9999
_httpHandler.handleGetRequest(request);

pkg/analysis_server/lib/src/services/completion/postfix/postfix_completion.dart

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ abstract final class DartPostfixCompletion {
133133
static Future<PostfixCompletion?> expandAssert(
134134
PostfixCompletionProcessor processor,
135135
PostfixCompletionKind kind,
136-
) async {
136+
) {
137137
return processor.expand(kind, processor.findAssertExpression, (expr) {
138138
return 'assert(${processor.utils.getNodeText(expr)});';
139139
}, withBraces: false);
@@ -142,7 +142,7 @@ abstract final class DartPostfixCompletion {
142142
static Future<PostfixCompletion?> expandElse(
143143
PostfixCompletionProcessor processor,
144144
PostfixCompletionKind kind,
145-
) async {
145+
) {
146146
return processor.expand(
147147
kind,
148148
processor.findBoolExpression,
@@ -153,7 +153,7 @@ abstract final class DartPostfixCompletion {
153153
static Future<PostfixCompletion?> expandFor(
154154
PostfixCompletionProcessor processor,
155155
PostfixCompletionKind kind,
156-
) async {
156+
) {
157157
return processor.expand(kind, processor.findIterableExpression, (expr) {
158158
var value = processor.newVariable('value');
159159
return 'for (var $value in ${processor.utils.getNodeText(expr)})';
@@ -163,7 +163,7 @@ abstract final class DartPostfixCompletion {
163163
static Future<PostfixCompletion?> expandFori(
164164
PostfixCompletionProcessor processor,
165165
PostfixCompletionKind kind,
166-
) async {
166+
) {
167167
return processor.expand(kind, processor.findIntExpression, (expr) {
168168
var index = processor.newVariable('i');
169169
return 'for (int $index = 0; $index < ${processor.utils.getNodeText(expr)}; $index++)';
@@ -173,7 +173,7 @@ abstract final class DartPostfixCompletion {
173173
static Future<PostfixCompletion?> expandIf(
174174
PostfixCompletionProcessor processor,
175175
PostfixCompletionKind kind,
176-
) async {
176+
) {
177177
return processor.expand(
178178
kind,
179179
processor.findBoolExpression,
@@ -184,7 +184,7 @@ abstract final class DartPostfixCompletion {
184184
static Future<PostfixCompletion?> expandNegate(
185185
PostfixCompletionProcessor processor,
186186
PostfixCompletionKind kind,
187-
) async {
187+
) {
188188
return processor.expand(
189189
kind,
190190
processor.findBoolExpression,
@@ -196,7 +196,7 @@ abstract final class DartPostfixCompletion {
196196
static Future<PostfixCompletion?> expandNotNull(
197197
PostfixCompletionProcessor processor,
198198
PostfixCompletionKind kind,
199-
) async {
199+
) {
200200
return processor.expand(kind, processor.findObjectExpression, (expr) {
201201
return expr is NullLiteral
202202
? 'if (false)'
@@ -207,7 +207,7 @@ abstract final class DartPostfixCompletion {
207207
static Future<PostfixCompletion?> expandNull(
208208
PostfixCompletionProcessor processor,
209209
PostfixCompletionKind kind,
210-
) async {
210+
) {
211211
return processor.expand(kind, processor.findObjectExpression, (expr) {
212212
return expr is NullLiteral
213213
? 'if (true)'
@@ -218,7 +218,7 @@ abstract final class DartPostfixCompletion {
218218
static Future<PostfixCompletion?> expandParen(
219219
PostfixCompletionProcessor processor,
220220
PostfixCompletionKind kind,
221-
) async {
221+
) {
222222
return processor.expand(
223223
kind,
224224
processor.findObjectExpression,
@@ -230,7 +230,7 @@ abstract final class DartPostfixCompletion {
230230
static Future<PostfixCompletion?> expandReturn(
231231
PostfixCompletionProcessor processor,
232232
PostfixCompletionKind kind,
233-
) async {
233+
) {
234234
return processor.expand(
235235
kind,
236236
processor.findObjectExpression,
@@ -242,7 +242,7 @@ abstract final class DartPostfixCompletion {
242242
static Future<PostfixCompletion?> expandSwitch(
243243
PostfixCompletionProcessor processor,
244244
PostfixCompletionKind kind,
245-
) async {
245+
) {
246246
return processor.expand(
247247
kind,
248248
processor.findObjectExpression,
@@ -253,21 +253,21 @@ abstract final class DartPostfixCompletion {
253253
static Future<PostfixCompletion?> expandTry(
254254
PostfixCompletionProcessor processor,
255255
PostfixCompletionKind kind,
256-
) async {
256+
) {
257257
return processor.expandTry(kind, processor.findStatement);
258258
}
259259

260260
static Future<PostfixCompletion?> expandTryon(
261261
PostfixCompletionProcessor processor,
262262
PostfixCompletionKind kind,
263-
) async {
263+
) {
264264
return processor.expandTry(kind, processor.findStatement, withOn: true);
265265
}
266266

267267
static Future<PostfixCompletion?> expandWhile(
268268
PostfixCompletionProcessor processor,
269269
PostfixCompletionKind kind,
270-
) async {
270+
) {
271271
return processor.expand(
272272
kind,
273273
processor.findBoolExpression,

0 commit comments

Comments
 (0)