diff --git a/pkg/analysis_server/benchmark/integration/driver.dart b/pkg/analysis_server/benchmark/integration/driver.dart index 07882b869516..f551d70310a3 100644 --- a/pkg/analysis_server/benchmark/integration/driver.dart +++ b/pkg/analysis_server/benchmark/integration/driver.dart @@ -70,7 +70,7 @@ class Driver extends IntegrationTest { /// Launch the analysis server. /// /// Return a [Future] that completes when analysis server has started. - Future startServer() async { + Future startServer() { logger.log(Level.FINE, 'starting server'); server = Server(); var serverConnected = Completer(); diff --git a/pkg/analysis_server/lib/src/cider/completion.dart b/pkg/analysis_server/lib/src/cider/completion.dart index 6420567c831f..4cb286ee191e 100644 --- a/pkg/analysis_server/lib/src/cider/completion.dart +++ b/pkg/analysis_server/lib/src/cider/completion.dart @@ -55,11 +55,11 @@ class CiderCompletionComputer { required int column, @visibleForTesting void Function(ResolvedForCompletionResultImpl)? testResolvedUnit, - }) async { + }) { return _performanceRoot.runAsync('completion', (performance) async { var resolvedUnit = await performance.runAsync('resolution', ( performance, - ) async { + ) { return _fileResolver.resolveForCompletion( completionLine: line, completionColumn: column, diff --git a/pkg/analysis_server/lib/src/context_manager.dart b/pkg/analysis_server/lib/src/context_manager.dart index 4409bc41001b..7b3b158ef804 100644 --- a/pkg/analysis_server/lib/src/context_manager.dart +++ b/pkg/analysis_server/lib/src/context_manager.dart @@ -553,7 +553,7 @@ class ContextManagerImpl implements ContextManager { /// rebuild will occur only once it has exited. /// /// Returns a [Future] that completes once the requested rebuild completes. - Future _createAnalysisContexts() async { + Future _createAnalysisContexts() { /// A helper that performs a context rebuild while monitoring the included /// paths for changes until the contexts file watchers are ready. /// diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_code_actions.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_code_actions.dart index 2ae87775e108..6366d13df3da 100644 --- a/pkg/analysis_server/lib/src/lsp/handlers/handler_code_actions.dart +++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_code_actions.dart @@ -39,7 +39,7 @@ class CodeActionHandler CodeActionParams params, MessageInfo message, CancellationToken token, - ) async { + ) { var performance = message.performance; var textDocument = params.textDocument; diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_semantic_tokens.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_semantic_tokens.dart index 27aef5a15673..b296b9905a57 100644 --- a/pkg/analysis_server/lib/src/lsp/handlers/handler_semantic_tokens.dart +++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_semantic_tokens.dart @@ -58,7 +58,7 @@ abstract class AbstractSemanticTokensHandler TextDocumentIdentifier textDocument, CancellationToken token, { Range? range, - }) async { + }) { var path = pathOfDoc(textDocument); return path.mapResult((path) async { diff --git a/pkg/analysis_server/lib/src/lsp/temporary_overlay_operation.dart b/pkg/analysis_server/lib/src/lsp/temporary_overlay_operation.dart index 4acf20312112..811ee9374ddf 100644 --- a/pkg/analysis_server/lib/src/lsp/temporary_overlay_operation.dart +++ b/pkg/analysis_server/lib/src/lsp/temporary_overlay_operation.dart @@ -86,7 +86,7 @@ abstract class TemporaryOverlayOperation { /// temporary overlays and re-enabled after the overlays are restored. Future lockRequestsWithTemporaryOverlays( Future Function() operation, - ) async { + ) { return server.lockRequestsWhile(() async { // Wait for any in-progress analysis to complete before we start // suppressing analysis results. diff --git a/pkg/analysis_server/lib/src/search/element_references.dart b/pkg/analysis_server/lib/src/search/element_references.dart index 2fd41bd211d4..42ad32a40d82 100644 --- a/pkg/analysis_server/lib/src/search/element_references.dart +++ b/pkg/analysis_server/lib/src/search/element_references.dart @@ -68,9 +68,7 @@ class ElementReferencesComputer { } /// Returns a [Future] completing with a [List] of references to [element]. - Future> _findSingleElementReferences( - Element2 element, - ) async { + Future> _findSingleElementReferences(Element2 element) { return searchEngine.searchReferences(element); } diff --git a/pkg/analysis_server/lib/src/server/driver.dart b/pkg/analysis_server/lib/src/server/driver.dart index 75f168420fb3..28b9aeaf8353 100644 --- a/pkg/analysis_server/lib/src/server/driver.dart +++ b/pkg/analysis_server/lib/src/server/driver.dart @@ -512,7 +512,7 @@ class Driver implements ServerStarter { capture(instrumentationService, () { var stdioServer = LspStdioAnalysisServer(socketServer); - stdioServer.serveStdio().then((_) async { + stdioServer.serveStdio().then((_) { // Only shutdown the server and exit if the server is not already // handling the shutdown. if (!socketServer.analysisServer!.willExit) { diff --git a/pkg/analysis_server/lib/src/server/http_server.dart b/pkg/analysis_server/lib/src/server/http_server.dart index 91dd513f4fe4..b2f91fd226c9 100644 --- a/pkg/analysis_server/lib/src/server/http_server.dart +++ b/pkg/analysis_server/lib/src/server/http_server.dart @@ -93,7 +93,7 @@ class HttpAnalysisServer { /// Attach a listener to a newly created HTTP server. void _handleServer(HttpServer httpServer) { - httpServer.listen((HttpRequest request) async { + httpServer.listen((HttpRequest request) { var updateValues = request.headers[HttpHeaders.upgradeHeader]; if (request.method == 'GET') { _httpHandler.handleGetRequest(request); diff --git a/pkg/analysis_server/lib/src/services/completion/postfix/postfix_completion.dart b/pkg/analysis_server/lib/src/services/completion/postfix/postfix_completion.dart index 25156960b81b..b039816b8aad 100644 --- a/pkg/analysis_server/lib/src/services/completion/postfix/postfix_completion.dart +++ b/pkg/analysis_server/lib/src/services/completion/postfix/postfix_completion.dart @@ -133,7 +133,7 @@ abstract final class DartPostfixCompletion { static Future expandAssert( PostfixCompletionProcessor processor, PostfixCompletionKind kind, - ) async { + ) { return processor.expand(kind, processor.findAssertExpression, (expr) { return 'assert(${processor.utils.getNodeText(expr)});'; }, withBraces: false); @@ -142,7 +142,7 @@ abstract final class DartPostfixCompletion { static Future expandElse( PostfixCompletionProcessor processor, PostfixCompletionKind kind, - ) async { + ) { return processor.expand( kind, processor.findBoolExpression, @@ -153,7 +153,7 @@ abstract final class DartPostfixCompletion { static Future expandFor( PostfixCompletionProcessor processor, PostfixCompletionKind kind, - ) async { + ) { return processor.expand(kind, processor.findIterableExpression, (expr) { var value = processor.newVariable('value'); return 'for (var $value in ${processor.utils.getNodeText(expr)})'; @@ -163,7 +163,7 @@ abstract final class DartPostfixCompletion { static Future expandFori( PostfixCompletionProcessor processor, PostfixCompletionKind kind, - ) async { + ) { return processor.expand(kind, processor.findIntExpression, (expr) { var index = processor.newVariable('i'); return 'for (int $index = 0; $index < ${processor.utils.getNodeText(expr)}; $index++)'; @@ -173,7 +173,7 @@ abstract final class DartPostfixCompletion { static Future expandIf( PostfixCompletionProcessor processor, PostfixCompletionKind kind, - ) async { + ) { return processor.expand( kind, processor.findBoolExpression, @@ -184,7 +184,7 @@ abstract final class DartPostfixCompletion { static Future expandNegate( PostfixCompletionProcessor processor, PostfixCompletionKind kind, - ) async { + ) { return processor.expand( kind, processor.findBoolExpression, @@ -196,7 +196,7 @@ abstract final class DartPostfixCompletion { static Future expandNotNull( PostfixCompletionProcessor processor, PostfixCompletionKind kind, - ) async { + ) { return processor.expand(kind, processor.findObjectExpression, (expr) { return expr is NullLiteral ? 'if (false)' @@ -207,7 +207,7 @@ abstract final class DartPostfixCompletion { static Future expandNull( PostfixCompletionProcessor processor, PostfixCompletionKind kind, - ) async { + ) { return processor.expand(kind, processor.findObjectExpression, (expr) { return expr is NullLiteral ? 'if (true)' @@ -218,7 +218,7 @@ abstract final class DartPostfixCompletion { static Future expandParen( PostfixCompletionProcessor processor, PostfixCompletionKind kind, - ) async { + ) { return processor.expand( kind, processor.findObjectExpression, @@ -230,7 +230,7 @@ abstract final class DartPostfixCompletion { static Future expandReturn( PostfixCompletionProcessor processor, PostfixCompletionKind kind, - ) async { + ) { return processor.expand( kind, processor.findObjectExpression, @@ -242,7 +242,7 @@ abstract final class DartPostfixCompletion { static Future expandSwitch( PostfixCompletionProcessor processor, PostfixCompletionKind kind, - ) async { + ) { return processor.expand( kind, processor.findObjectExpression, @@ -253,21 +253,21 @@ abstract final class DartPostfixCompletion { static Future expandTry( PostfixCompletionProcessor processor, PostfixCompletionKind kind, - ) async { + ) { return processor.expandTry(kind, processor.findStatement); } static Future expandTryon( PostfixCompletionProcessor processor, PostfixCompletionKind kind, - ) async { + ) { return processor.expandTry(kind, processor.findStatement, withOn: true); } static Future expandWhile( PostfixCompletionProcessor processor, PostfixCompletionKind kind, - ) async { + ) { return processor.expand( kind, processor.findBoolExpression, 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 e53e8755f705..4a7ae9a103a8 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 @@ -1100,7 +1100,7 @@ class IterativeBulkFixProcessor { OperationPerformanceImpl performance, String path, { required bool autoTriggered, - }) async { + }) { return performance.runAsync('IterativeBulkFixProcessor.fixErrorsForFile', ( performance, ) async { diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_const.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_const.dart index 08ebd215977b..ee04dfd396a1 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/remove_const.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_const.dart @@ -134,12 +134,12 @@ abstract class _RemoveConst extends ParsedCorrectionProducer { if (constKeyword != null) { switch (constantContext.$1) { case InstanceCreationExpression contextNode: - await builder.addDartFileEdit(file, (builder) async { + await builder.addDartFileEdit(file, (builder) { _deleteToken(builder, constKeyword); contextNode.accept(_PushConstVisitor(builder, expression)); }); case TypedLiteral contextNode: - await builder.addDartFileEdit(file, (builder) async { + await builder.addDartFileEdit(file, (builder) { _deleteToken(builder, constKeyword); contextNode.accept(_PushConstVisitor(builder, expression)); }); diff --git a/pkg/analysis_server/lib/src/services/dart_tooling_daemon/dtd_services.dart b/pkg/analysis_server/lib/src/services/dart_tooling_daemon/dtd_services.dart index a7260892ccc7..4899305ae1fe 100644 --- a/pkg/analysis_server/lib/src/services/dart_tooling_daemon/dtd_services.dart +++ b/pkg/analysis_server/lib/src/services/dart_tooling_daemon/dtd_services.dart @@ -84,7 +84,7 @@ class DtdServices { IncomingMessage message, OperationPerformanceImpl performance, Completer> completer, - Completer schedulerCompleter, + Completer schedulerCompleter, ) async { var info = MessageInfo( performance: performance, @@ -189,7 +189,7 @@ class DtdServices { Method method, Parameters params, OperationPerformanceImpl performance, - ) async { + ) { // Map the incoming request into types we use for LSP request handling. var message = IncomingMessage( jsonrpc: jsonRpcVersion, diff --git a/pkg/analysis_server/lib/src/services/refactoring/agnostic/change_method_signature.dart b/pkg/analysis_server/lib/src/services/refactoring/agnostic/change_method_signature.dart index 0d430ebb300b..7de2c63208ef 100644 --- a/pkg/analysis_server/lib/src/services/refactoring/agnostic/change_method_signature.dart +++ b/pkg/analysis_server/lib/src/services/refactoring/agnostic/change_method_signature.dart @@ -36,7 +36,7 @@ Availability analyzeAvailability({ /// Continues analysis of the selection in [available], and returns either /// a [ValidSelectionState], or one of [ErrorSelectionState] subtypes. -Future analyzeSelection({required Available available}) async { +Future analyzeSelection({required Available available}) { return _SelectionAnalyzer(available: available).analyze(); } diff --git a/pkg/analysis_server/test/analysis/get_signature_test.dart b/pkg/analysis_server/test/analysis/get_signature_test.dart index b18dc2360859..433b81b6798e 100644 --- a/pkg/analysis_server/test/analysis/get_signature_test.dart +++ b/pkg/analysis_server/test/analysis/get_signature_test.dart @@ -21,7 +21,7 @@ class AnalysisSignatureTest extends PubPackageAnalysisServerTest { return prepareRawSignatureAt(offset); } - Future prepareRawSignatureAt(int offset, {String? file}) async { + Future prepareRawSignatureAt(int offset, {String? file}) { var request = AnalysisGetSignatureParams( file ?? testFile.path, offset, diff --git a/pkg/analysis_server/test/domain_completion_test.dart b/pkg/analysis_server/test/domain_completion_test.dart index 5991bb8b5068..906b9a121bc7 100644 --- a/pkg/analysis_server/test/domain_completion_test.dart +++ b/pkg/analysis_server/test/domain_completion_test.dart @@ -242,7 +242,7 @@ completion: Test String content, { required String completion, required String libraryUri, - }) async { + }) { return _getCodeDetails( path: convertPath(testFilePath), content: content, diff --git a/pkg/analysis_server/test/edit/refactoring_test.dart b/pkg/analysis_server/test/edit/refactoring_test.dart index a364dab48643..c722009a32c8 100644 --- a/pkg/analysis_server/test/edit/refactoring_test.dart +++ b/pkg/analysis_server/test/edit/refactoring_test.dart @@ -933,7 +933,7 @@ class GetAvailableRefactoringsTest extends PubPackageAnalysisServerTest { } /// Tests that there is a RENAME refactoring available at the [search] offset. - Future assertHasRenameRefactoring(String code, String search) async { + Future assertHasRenameRefactoring(String code, String search) { return assertHasKind(code, search, RefactoringKind.RENAME, true); } @@ -1516,7 +1516,7 @@ import 'dart:math'; import 'original_folder/file.dart'; '''); _setOptions('$testPackageLibPath/new_folder'); - return assertEmptySuccessfulRefactoring(() async { + return assertEmptySuccessfulRefactoring(() { return _sendAndCancelMoveRequest( getFolder('$testPackageLibPath/original_folder').path, ); @@ -1531,7 +1531,7 @@ import 'original_folder/file.dart'; '''); _setOptions('$testPackageLibPath/new_folder'); return assertSuccessfulRefactoring( - () async { + () { return _sendMoveRequest( getFolder('$testPackageLibPath/original_folder').path, ); diff --git a/pkg/analysis_server/test/edit/sort_members_test.dart b/pkg/analysis_server/test/edit/sort_members_test.dart index 097f8eeac461..94d51ffabcb0 100644 --- a/pkg/analysis_server/test/edit/sort_members_test.dart +++ b/pkg/analysis_server/test/edit/sort_members_test.dart @@ -109,7 +109,7 @@ class C {} '''); } - Future test_OK_classMembers_method() async { + Future test_OK_classMembers_method() { addTestFile(''' class A { c() {} @@ -126,7 +126,7 @@ class A { '''); } - Future test_OK_directives() async { + Future test_OK_directives() { addTestFile(''' library lib; @@ -177,7 +177,7 @@ void f() { '''); } - Future test_OK_directives_withAnnotation() async { + Future test_OK_directives_withAnnotation() { addTestFile(''' library lib; @@ -211,7 +211,7 @@ class MyAnnotation { '''); } - Future test_OK_genericFunctionType() async { + Future test_OK_genericFunctionType() { addTestFile(''' class C { void caller() { @@ -278,7 +278,7 @@ class Z { '''); } - Future test_OK_unitMembers_class() async { + Future test_OK_unitMembers_class() { addTestFile(''' class C {} class A {} diff --git a/pkg/analysis_server/test/integration/analysis/get_hover_test.dart b/pkg/analysis_server/test/integration/analysis/get_hover_test.dart index d7c2273b8cda..b4cbdb4d5b18 100644 --- a/pkg/analysis_server/test/integration/analysis/get_hover_test.dart +++ b/pkg/analysis_server/test/integration/analysis/get_hover_test.dart @@ -65,7 +65,7 @@ void f() { Matcher? parameter = isNull, }) { var offset = text.indexOf(target); - return sendAnalysisGetHover(pathname, offset).then((result) async { + return sendAnalysisGetHover(pathname, offset).then((result) { expect(result.hovers, hasLength(1)); var info = result.hovers[0]; expect(info.offset, equals(offset)); diff --git a/pkg/analysis_server/test/integration/server/message_scheduler_test.dart b/pkg/analysis_server/test/integration/server/message_scheduler_test.dart index 15c0bade0ae3..2e50de86e1ba 100644 --- a/pkg/analysis_server/test/integration/server/message_scheduler_test.dart +++ b/pkg/analysis_server/test/integration/server/message_scheduler_test.dart @@ -303,7 +303,7 @@ void f() { // Respond to any applyEdit requests from the server with successful responses // and capturing the last edit. - requestsFromServer.listen((request) async { + requestsFromServer.listen((request) { if (request.method == Method.workspace_applyEdit) { ApplyWorkspaceEditParams.fromJson( request.params as Map, diff --git a/pkg/analysis_server/test/lsp/code_actions_refactor_test.dart b/pkg/analysis_server/test/lsp/code_actions_refactor_test.dart index 84d6ced41a71..b1275cc9e263 100644 --- a/pkg/analysis_server/test/lsp/code_actions_refactor_test.dart +++ b/pkg/analysis_server/test/lsp/code_actions_refactor_test.dart @@ -170,7 +170,7 @@ void newMethod() { // Respond to any applyEdit requests from the server with successful responses // and capturing the last edit. late WorkspaceEdit edit; - requestsFromServer.listen((request) async { + requestsFromServer.listen((request) { if (request.method == Method.workspace_applyEdit) { var params = ApplyWorkspaceEditParams.fromJson( request.params as Map, diff --git a/pkg/analysis_server/test/lsp/rename_test.dart b/pkg/analysis_server/test/lsp/rename_test.dart index 4748d731da4c..c0510e9dad7c 100644 --- a/pkg/analysis_server/test/lsp/rename_test.dart +++ b/pkg/analysis_server/test/lsp/rename_test.dart @@ -30,7 +30,7 @@ final a = new [!My^Class!](); return _test_prepare(content, 'MyClass'); } - Future test_prepare_class_newKeyword() async { + Future test_prepare_class_newKeyword() { const content = ''' class MyClass {} final a = n^ew [!MyClass!](); @@ -47,7 +47,7 @@ class [!MyClass^!] {} return _test_prepare(content, 'MyClass'); } - Future test_prepare_class_typeParameter_atDeclaration() async { + Future test_prepare_class_typeParameter_atDeclaration() { const content = ''' class A<[!T^!]> { final List values = []; @@ -57,7 +57,7 @@ class A<[!T^!]> { return _test_prepare(content, 'T'); } - Future test_prepare_class_typeParameter_atReference() async { + Future test_prepare_class_typeParameter_atReference() { const content = ''' class A { final List<[!T^!]> values = []; @@ -92,7 +92,7 @@ final a = MyEnum.[!o^ne!]; return _test_prepare(content, 'one'); } - Future test_prepare_extensionType_onName_begin() async { + Future test_prepare_extensionType_onName_begin() { const content = ''' extension type [!^MyType!](int it) {} '''; @@ -100,7 +100,7 @@ extension type [!^MyType!](int it) {} return _test_prepare(content, 'MyType'); } - Future test_prepare_extensionType_onName_end() async { + Future test_prepare_extensionType_onName_end() { const content = ''' extension type [!MyType^!](int it) {} '''; @@ -108,7 +108,7 @@ extension type [!MyType^!](int it) {} return _test_prepare(content, 'MyType'); } - Future test_prepare_extensionType_onName_inside() async { + Future test_prepare_extensionType_onName_inside() { const content = ''' extension type [!My^Type!](int it) {} '''; @@ -132,7 +132,7 @@ void [!aaaa!]^() {} return _test_prepare(content, 'aaaa'); } - Future test_prepare_importPrefix() async { + Future test_prepare_importPrefix() { const content = ''' import 'dart:async' as [!myPr^efix!]; '''; @@ -140,7 +140,7 @@ import 'dart:async' as [!myPr^efix!]; return _test_prepare(content, 'myPrefix'); } - Future test_prepare_importWithoutPrefix() async { + Future test_prepare_importWithoutPrefix() { const content = ''' imp[!^!]ort 'dart:async'; '''; @@ -148,7 +148,7 @@ imp[!^!]ort 'dart:async'; return _test_prepare(content, ''); } - Future test_prepare_importWithPrefix() async { + Future test_prepare_importWithPrefix() { const content = ''' imp^ort 'dart:async' as [!myPrefix!]; '''; @@ -156,7 +156,7 @@ imp^ort 'dart:async' as [!myPrefix!]; return _test_prepare(content, 'myPrefix'); } - Future test_prepare_invalidRenameLocation() async { + Future test_prepare_invalidRenameLocation() { const content = ''' void f() { // comm^ent @@ -210,7 +210,7 @@ final a = new [!Ob^ject!](); expect(response.error!.message, contains('is defined in the SDK')); } - Future test_prepare_variable() async { + Future test_prepare_variable() { const content = ''' void f() { var variable = 0; @@ -221,7 +221,7 @@ void f() { return _test_prepare(content, 'variable'); } - Future test_prepare_variable_forEach_statement() async { + Future test_prepare_variable_forEach_statement() { const content = ''' void f(List values) { for (final [!value^!] in values) { @@ -290,7 +290,7 @@ final a = new MyNewMain(); ); } - Future test_rename_class_doesRenameFile_afterPrompt() async { + Future test_rename_class_doesRenameFile_afterPrompt() { const content = ''' class Main {} final a = new [!Ma^in!](); diff --git a/pkg/analysis_server/test/lsp/request_helpers_mixin.dart b/pkg/analysis_server/test/lsp/request_helpers_mixin.dart index 50dd53686359..093736c750f7 100644 --- a/pkg/analysis_server/test/lsp/request_helpers_mixin.dart +++ b/pkg/analysis_server/test/lsp/request_helpers_mixin.dart @@ -99,7 +99,7 @@ mixin LspProgressNotificationsMixin { requestsFromServer .where((r) => r.method == Method.window_workDoneProgress_create) - .listen((request) async { + .listen((request) { var params = WorkDoneProgressCreateParams.fromJson( request.params as Map, ); diff --git a/pkg/analysis_server/test/lsp/server_abstract.dart b/pkg/analysis_server/test/lsp/server_abstract.dart index f00321b133dc..fd8512aab772 100644 --- a/pkg/analysis_server/test/lsp/server_abstract.dart +++ b/pkg/analysis_server/test/lsp/server_abstract.dart @@ -214,8 +214,8 @@ abstract class AbstractLspAnalysisServerTest List extractTextDocumentEdits( DocumentChanges documentChanges, ) => - // Extract TextDocumentEdits from union of resource changes - documentChanges + // Extract TextDocumentEdits from union of resource changes + documentChanges .map( (change) => change.map( (create) => null, @@ -323,7 +323,7 @@ abstract class AbstractLspAnalysisServerTest httpClient: httpClient, processRunner: processRunner, dartFixPromptManager: dartFixPromptManager, - retainDataForTesting: retainDataForTesting, + retainDataForTesting: retainDataForTesting, ); errorNotifier.server = server; server.pluginManager = pluginManager; @@ -1057,9 +1057,7 @@ mixin LspAnalysisServerTestMixin on LspRequestHelpersMixin, LspEditHelpersMixin await sendNotificationToServer(notification); } - Future executeCodeAction( - Either2 codeAction, - ) async { + Future executeCodeAction(Either2 codeAction) { var command = codeAction.map( (command) => command, (codeAction) => codeAction.command!, @@ -1071,7 +1069,7 @@ mixin LspAnalysisServerTestMixin on LspRequestHelpersMixin, LspEditHelpersMixin Command command, { T Function(Map)? decoder, ProgressToken? workDoneToken, - }) async { + }) { var supportedCommands = _serverCapabilities?.executeCommandProvider?.commands ?? []; if (!supportedCommands.contains(command.command)) { @@ -1677,7 +1675,7 @@ mixin LspAnalysisServerTestMixin on LspRequestHelpersMixin, LspEditHelpersMixin return closingLabelsParams.labels; } - Future?> waitForDiagnostics(Uri uri) async { + Future?> waitForDiagnostics(Uri uri) { return publishedDiagnostics .where((params) => params.uri == uri) .map?>((params) => params.diagnostics) diff --git a/pkg/analysis_server/test/lsp/server_test.dart b/pkg/analysis_server/test/lsp/server_test.dart index 13b331269176..a4e23f4502b7 100644 --- a/pkg/analysis_server/test/lsp/server_test.dart +++ b/pkg/analysis_server/test/lsp/server_test.dart @@ -148,7 +148,7 @@ class ServerTest extends AbstractLspAnalysisServerTest { failTestOnAnyErrorNotification = false; await initialize(); - var error = await expectErrorNotification(() async { + var error = await expectErrorNotification(() { errorNotifier.logException(Exception('dummy exception')); }); @@ -161,7 +161,7 @@ class ServerTest extends AbstractLspAnalysisServerTest { failTestOnAnyErrorNotification = false; await initialize(); - var error = await expectErrorNotification(() async { + var error = await expectErrorNotification(() { server.sendServerErrorNotification( 'message', Exception('dummy exception'), diff --git a/pkg/analysis_server/test/services/user_prompts/survey_manager_test.dart b/pkg/analysis_server/test/services/user_prompts/survey_manager_test.dart index bffc0864085c..c21f50bd3fe4 100644 --- a/pkg/analysis_server/test/services/user_prompts/survey_manager_test.dart +++ b/pkg/analysis_server/test/services/user_prompts/survey_manager_test.dart @@ -234,7 +234,7 @@ class TestSurveyManager extends SurveyManager { }); @override - Future checkForSurveys() async { + Future checkForSurveys() { numberOfChecksPerformed++; return super.checkForSurveys(); } diff --git a/pkg/analysis_server/test/src/cider/document_symbols_test.dart b/pkg/analysis_server/test/src/cider/document_symbols_test.dart index d2a0dda3294d..43a2599716a3 100644 --- a/pkg/analysis_server/test/src/cider/document_symbols_test.dart +++ b/pkg/analysis_server/test/src/cider/document_symbols_test.dart @@ -304,7 +304,7 @@ void f() { ); } - Future> _compute(String content) async { + Future> _compute(String content) { newFile(testPath, content); return CiderDocumentSymbolsComputer( fileResolver, diff --git a/pkg/analysis_server/test/src/cider/rename_test.dart b/pkg/analysis_server/test/src/cider/rename_test.dart index d35d4d405db2..dfe172b80f82 100644 --- a/pkg/analysis_server/test/src/cider/rename_test.dart +++ b/pkg/analysis_server/test/src/cider/rename_test.dart @@ -904,7 +904,7 @@ void f(bar a) {} return canRename?.checkNewName(newName); } - Future _compute(String content) async { + Future _compute(String content) { _updateFile(content); return CiderRenameComputer(fileResolver).canRename2( diff --git a/pkg/analysis_server/test/src/cider/signature_help_test.dart b/pkg/analysis_server/test/src/cider/signature_help_test.dart index a23ae4ebcb9f..8aa4d3e662aa 100644 --- a/pkg/analysis_server/test/src/cider/signature_help_test.dart +++ b/pkg/analysis_server/test/src/cider/signature_help_test.dart @@ -191,7 +191,7 @@ class Foo { expect(result.callStart == leftParenLocation, isTrue); } - Future _compute(String content) async { + Future _compute(String content) { _updateFile(content); return CiderSignatureHelpComputer(fileResolver).compute2( diff --git a/pkg/analysis_server/test/src/services/flutter/widget_description.dart b/pkg/analysis_server/test/src/services/flutter/widget_description.dart index 11d184344f13..bb5cd399edc2 100644 --- a/pkg/analysis_server/test/src/services/flutter/widget_description.dart +++ b/pkg/analysis_server/test/src/services/flutter/widget_description.dart @@ -50,7 +50,7 @@ class WidgetDescriptionBase extends AbstractSingleUnitTest { Future getDescription( String search, - ) async { + ) { var content = testAnalysisResult.content; var offset = content.indexOf(search); diff --git a/pkg/analysis_server/test/src/utilities/profiling_test.dart b/pkg/analysis_server/test/src/utilities/profiling_test.dart index 1d66d7fda959..670bfffde658 100644 --- a/pkg/analysis_server/test/src/utilities/profiling_test.dart +++ b/pkg/analysis_server/test/src/utilities/profiling_test.dart @@ -10,7 +10,7 @@ import 'package:test/test.dart'; void main() { group('ProcessProfiler', () { - test('getProfilerForPlatform', () async { + test('getProfilerForPlatform', () { expect(ProcessProfiler.getProfilerForPlatform(), isNotNull); }); diff --git a/pkg/analysis_server/test/verify_sorted_test.dart b/pkg/analysis_server/test/verify_sorted_test.dart index 89be1cf2bbcb..93fc172060ce 100644 --- a/pkg/analysis_server/test/verify_sorted_test.dart +++ b/pkg/analysis_server/test/verify_sorted_test.dart @@ -144,7 +144,7 @@ void buildTestsIn( continue; } var relativePath = pathContext.relative(path, from: testDirPath); - test(relativePath, () async { + test(relativePath, () { var result = session.getParsedUnit(path); if (result is! ParsedUnitResult) { fail('Could not parse $path'); diff --git a/pkg/analysis_server_plugin/lib/edit/fix/dart_fix_context.dart b/pkg/analysis_server_plugin/lib/edit/fix/dart_fix_context.dart index f0652e58aec8..a488fa8b97ae 100644 --- a/pkg/analysis_server_plugin/lib/edit/fix/dart_fix_context.dart +++ b/pkg/analysis_server_plugin/lib/edit/fix/dart_fix_context.dart @@ -55,8 +55,7 @@ class DartFixContext implements FixContext { /// this library, and has the requested base name. /// /// For getters and setters the corresponding top-level variable is returned. - Future> getTopLevelDeclarations( - String name) async { + Future> getTopLevelDeclarations(String name) { return TopLevelDeclarations(unitResult).withName(name); } diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart index 01fa4e146606..38b40fe703ab 100644 --- a/pkg/analyzer/lib/src/dart/analysis/driver.dart +++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart @@ -711,7 +711,7 @@ class AnalysisDriver { } /// Notify the driver that the client is going to stop using it. - Future dispose2() async { + Future dispose2() { var completer = Completer(); _disposed = true; _disposeRequests.add(completer); @@ -784,7 +784,7 @@ class AnalysisDriver { /// /// This method does not use analysis priorities, and must not be used in /// interactive analysis, such as Analysis Server or its plugins. - Future getErrors(String path) async { + Future getErrors(String path) { if (!_isAbsolutePath(path)) { return Future.value( InvalidPathResult(), @@ -1299,7 +1299,7 @@ class AnalysisDriver { required String path, required int offset, required OperationPerformanceImpl performance, - }) async { + }) { var request = _ResolveForCompletionRequest( path: path, offset: offset, @@ -1325,7 +1325,7 @@ class AnalysisDriver { Future _analyzeFileImpl({ required String path, required OperationPerformanceImpl performance, - }) async { + }) { // We will produce the result for this file, at least. // And for any other files of the same library. _fileTracker.fileWasAnalyzed(path); @@ -2037,7 +2037,7 @@ class AnalysisDriver { Future _resolveForCompletion( _ResolveForCompletionRequest request, - ) async { + ) { return request.performance.runAsync('body', (performance) async { var path = request.path; if (!_isAbsolutePath(path)) { diff --git a/pkg/analyzer/lib/src/dart/analysis/search.dart b/pkg/analyzer/lib/src/dart/analysis/search.dart index ef48c95eec07..31f8b00206f6 100644 --- a/pkg/analyzer/lib/src/dart/analysis/search.dart +++ b/pkg/analyzer/lib/src/dart/analysis/search.dart @@ -420,7 +420,7 @@ class Search { /// Returns references to the [element]. Future> references2( - Element2? element, SearchedFiles searchedFiles) async { + Element2? element, SearchedFiles searchedFiles) { return references(element.asElement, searchedFiles); } diff --git a/pkg/analyzer/lib/src/dart/micro/analysis_context.dart b/pkg/analyzer/lib/src/dart/micro/analysis_context.dart index c32de2771022..d8b54dc9f45a 100644 --- a/pkg/analyzer/lib/src/dart/micro/analysis_context.dart +++ b/pkg/analyzer/lib/src/dart/micro/analysis_context.dart @@ -166,12 +166,12 @@ class _MicroAnalysisSessionImpl extends AnalysisSessionImpl { } @override - Future getResolvedLibrary(String path) async { + Future getResolvedLibrary(String path) { return analysisContext.fileResolver.resolveLibrary2(path: path); } @override - Future getResolvedUnit(String path) async { + Future getResolvedUnit(String path) { return analysisContext.fileResolver.resolve(path: path); } diff --git a/pkg/analyzer/lib/src/dart/micro/resolve_file.dart b/pkg/analyzer/lib/src/dart/micro/resolve_file.dart index 4a9633188baa..606d36cde525 100644 --- a/pkg/analyzer/lib/src/dart/micro/resolve_file.dart +++ b/pkg/analyzer/lib/src/dart/micro/resolve_file.dart @@ -254,7 +254,7 @@ class FileResolver { /// Looks for references to the given Element. All the files currently /// cached by the resolver are searched, generated files are ignored. Future> findReferences2(Element element, - {OperationPerformanceImpl? performance}) async { + {OperationPerformanceImpl? performance}) { return logger.runAsync('findReferences for ${element.name}', () async { var references = []; @@ -302,7 +302,7 @@ class FileResolver { Future getErrors2({ required String path, OperationPerformanceImpl? performance, - }) async { + }) { _throwIfNotAbsoluteNormalizedPath(path); performance ??= OperationPerformanceImpl(''); @@ -514,7 +514,7 @@ class FileResolver { Future resolve({ required String path, OperationPerformanceImpl? performance, - }) async { + }) { _throwIfNotAbsoluteNormalizedPath(path); performance ??= OperationPerformanceImpl(''); @@ -552,7 +552,7 @@ class FileResolver { required int completionColumn, required String path, OperationPerformanceImpl? performance, - }) async { + }) { _throwIfNotAbsoluteNormalizedPath(path); performance ??= OperationPerformanceImpl(''); diff --git a/pkg/analyzer/lib/src/summary2/kernel_compilation_service.dart b/pkg/analyzer/lib/src/summary2/kernel_compilation_service.dart index cc52f3d51144..dfd4b3bf5465 100644 --- a/pkg/analyzer/lib/src/summary2/kernel_compilation_service.dart +++ b/pkg/analyzer/lib/src/summary2/kernel_compilation_service.dart @@ -40,7 +40,7 @@ class KernelCompilationService { var socketCompleter = Completer(); var serverSocket = await _loopbackServerSocket(); - serverSocket.listen((socket) async { + serverSocket.listen((socket) { socketCompleter.complete(socket); socket.setOption(io.SocketOption.tcpNoDelay, true); }); @@ -133,7 +133,7 @@ class KernelCompilationService { /// Stops the running `frontend_server` process. static Future dispose() { - return _lock.synchronized(() async { + return _lock.synchronized(() { var instance = _currentInstance; if (instance != null) { _currentInstance = null; diff --git a/pkg/analyzer/lib/src/summary2/macro.dart b/pkg/analyzer/lib/src/summary2/macro.dart index f1bb3caeba25..2ee109e16863 100644 --- a/pkg/analyzer/lib/src/summary2/macro.dart +++ b/pkg/analyzer/lib/src/summary2/macro.dart @@ -229,7 +229,7 @@ class MacroKernelBuilder { required MacroFileSystem fileSystem, required String packageFilePath, required List libraries, - }) async { + }) { var macroMainContent = macro.bootstrapMacroIsolate( { for (var library in libraries) diff --git a/pkg/analyzer/test/id_tests/assigned_variables_test.dart b/pkg/analyzer/test/id_tests/assigned_variables_test.dart index a28400b186c7..d3adab00fb70 100644 --- a/pkg/analyzer/test/id_tests/assigned_variables_test.dart +++ b/pkg/analyzer/test/id_tests/assigned_variables_test.dart @@ -15,7 +15,7 @@ import 'package:analyzer/src/util/ast_data_extractor.dart'; import '../util/id_testing_helper.dart'; -main(List args) async { +main(List args) { Directory dataDir = Directory.fromUri(Platform.script.resolve( '../../../_fe_analyzer_shared/test/flow_analysis/assigned_variables/' 'data')); diff --git a/pkg/analyzer/test/id_tests/constant_test.dart b/pkg/analyzer/test/id_tests/constant_test.dart index df82542c7fc6..b585eef78d51 100644 --- a/pkg/analyzer/test/id_tests/constant_test.dart +++ b/pkg/analyzer/test/id_tests/constant_test.dart @@ -19,7 +19,7 @@ import 'package:analyzer/src/util/ast_data_extractor.dart'; import '../util/id_testing_helper.dart'; -main(List args) async { +main(List args) { Directory dataDir = Directory.fromUri(Platform.script .resolve('../../../_fe_analyzer_shared/test/constants/data')); return runTests(dataDir, diff --git a/pkg/analyzer/test/id_tests/definite_assignment_test.dart b/pkg/analyzer/test/id_tests/definite_assignment_test.dart index ed10e6049bad..030ed6b881b0 100644 --- a/pkg/analyzer/test/id_tests/definite_assignment_test.dart +++ b/pkg/analyzer/test/id_tests/definite_assignment_test.dart @@ -16,7 +16,7 @@ import 'package:analyzer/src/util/ast_data_extractor.dart'; import '../util/id_testing_helper.dart'; -main(List args) async { +main(List args) { Directory dataDir = Directory.fromUri(Platform.script.resolve( '../../../_fe_analyzer_shared/test/flow_analysis/definite_assignment/' 'data')); diff --git a/pkg/analyzer/test/id_tests/definite_unassignment_test.dart b/pkg/analyzer/test/id_tests/definite_unassignment_test.dart index 298999891154..77a1b2123d90 100644 --- a/pkg/analyzer/test/id_tests/definite_unassignment_test.dart +++ b/pkg/analyzer/test/id_tests/definite_unassignment_test.dart @@ -16,7 +16,7 @@ import 'package:analyzer/src/util/ast_data_extractor.dart'; import '../util/id_testing_helper.dart'; -main(List args) async { +main(List args) { Directory dataDir = Directory.fromUri(Platform.script.resolve( '../../../_fe_analyzer_shared/test/flow_analysis/definite_unassignment/' 'data')); diff --git a/pkg/analyzer/test/id_tests/exhaustiveness_test.dart b/pkg/analyzer/test/id_tests/exhaustiveness_test.dart index 18108eec71db..9503629d237c 100644 --- a/pkg/analyzer/test/id_tests/exhaustiveness_test.dart +++ b/pkg/analyzer/test/id_tests/exhaustiveness_test.dart @@ -21,7 +21,7 @@ import 'package:analyzer/src/util/ast_data_extractor.dart'; import '../util/id_testing_helper.dart'; -main(List args) async { +main(List args) { Directory dataDir = Directory.fromUri(Platform.script .resolve('../../../_fe_analyzer_shared/test/exhaustiveness/data')); return runTests(dataDir, diff --git a/pkg/analyzer/test/id_tests/inferred_type_arguments_test.dart b/pkg/analyzer/test/id_tests/inferred_type_arguments_test.dart index 34000c24fa8d..705fc6fea9cb 100644 --- a/pkg/analyzer/test/id_tests/inferred_type_arguments_test.dart +++ b/pkg/analyzer/test/id_tests/inferred_type_arguments_test.dart @@ -13,7 +13,7 @@ import 'package:analyzer/src/util/ast_data_extractor.dart'; import '../util/id_testing_helper.dart'; -main(List args) async { +main(List args) { Directory dataDir = Directory.fromUri( Platform.script.resolve('../../../_fe_analyzer_shared/test/inference/' 'inferred_type_arguments/data')); diff --git a/pkg/analyzer/test/id_tests/inferred_variable_types_test.dart b/pkg/analyzer/test/id_tests/inferred_variable_types_test.dart index ad022734c444..c67b0eb1a024 100644 --- a/pkg/analyzer/test/id_tests/inferred_variable_types_test.dart +++ b/pkg/analyzer/test/id_tests/inferred_variable_types_test.dart @@ -13,7 +13,7 @@ import 'package:analyzer/src/util/ast_data_extractor.dart'; import '../util/id_testing_helper.dart'; -main(List args) async { +main(List args) { Directory dataDir = Directory.fromUri( Platform.script.resolve('../../../_fe_analyzer_shared/test/inference/' 'inferred_variable_types/data')); diff --git a/pkg/analyzer/test/id_tests/inheritance_test.dart b/pkg/analyzer/test/id_tests/inheritance_test.dart index 239b558fc316..e7073cf92802 100644 --- a/pkg/analyzer/test/id_tests/inheritance_test.dart +++ b/pkg/analyzer/test/id_tests/inheritance_test.dart @@ -16,7 +16,7 @@ import 'package:analyzer/src/util/ast_data_extractor.dart'; import '../util/id_testing_helper.dart'; -main(List args) async { +main(List args) { Directory dataDir = Directory.fromUri(Platform.script .resolve('../../../_fe_analyzer_shared/test/inheritance/data')); return runTests( diff --git a/pkg/analyzer/test/id_tests/metadata_evaluate_test.dart b/pkg/analyzer/test/id_tests/metadata_evaluate_test.dart index 358a58c0809e..bc58f09f4f0b 100644 --- a/pkg/analyzer/test/id_tests/metadata_evaluate_test.dart +++ b/pkg/analyzer/test/id_tests/metadata_evaluate_test.dart @@ -17,7 +17,7 @@ import 'package:analyzer/src/util/ast_data_extractor.dart'; import '../util/id_testing_helper.dart'; -main(List args) async { +main(List args) { Directory dataDir = Directory.fromUri(Platform.script .resolve('../../../_fe_analyzer_shared/test/metadata/evaluate_data')); return runTests( diff --git a/pkg/analyzer/test/id_tests/metadata_test.dart b/pkg/analyzer/test/id_tests/metadata_test.dart index 026f7d7fc0a4..d25c70095e9a 100644 --- a/pkg/analyzer/test/id_tests/metadata_test.dart +++ b/pkg/analyzer/test/id_tests/metadata_test.dart @@ -17,7 +17,7 @@ import 'package:analyzer/src/util/ast_data_extractor.dart'; import '../util/id_testing_helper.dart'; -main(List args) async { +main(List args) { Directory dataDir = Directory.fromUri(Platform.script .resolve('../../../_fe_analyzer_shared/test/metadata/data')); return runTests( diff --git a/pkg/analyzer/test/id_tests/nullability_test.dart b/pkg/analyzer/test/id_tests/nullability_test.dart index 8c34dd607f92..1d07150b5c96 100644 --- a/pkg/analyzer/test/id_tests/nullability_test.dart +++ b/pkg/analyzer/test/id_tests/nullability_test.dart @@ -16,7 +16,7 @@ import 'package:analyzer/src/util/ast_data_extractor.dart'; import '../util/id_testing_helper.dart'; -main(List args) async { +main(List args) { Directory dataDir = Directory.fromUri(Platform.script.resolve( '../../../_fe_analyzer_shared/test/flow_analysis/nullability/data')); return runTests(dataDir, diff --git a/pkg/analyzer/test/id_tests/reachability_test.dart b/pkg/analyzer/test/id_tests/reachability_test.dart index ef59b2196932..c44853222a95 100644 --- a/pkg/analyzer/test/id_tests/reachability_test.dart +++ b/pkg/analyzer/test/id_tests/reachability_test.dart @@ -13,7 +13,7 @@ import 'package:analyzer/src/util/ast_data_extractor.dart'; import '../util/id_testing_helper.dart'; -main(List args) async { +main(List args) { Directory dataDir = Directory.fromUri(Platform.script.resolve( '../../../_fe_analyzer_shared/test/flow_analysis/reachability/data')); return runTests>(dataDir, diff --git a/pkg/analyzer/test/id_tests/type_constraint_generation_test.dart b/pkg/analyzer/test/id_tests/type_constraint_generation_test.dart index 32165634c503..7e888cb6ac63 100644 --- a/pkg/analyzer/test/id_tests/type_constraint_generation_test.dart +++ b/pkg/analyzer/test/id_tests/type_constraint_generation_test.dart @@ -13,7 +13,7 @@ import 'package:analyzer/src/util/ast_data_extractor.dart'; import '../util/id_testing_helper.dart'; -main(List args) async { +main(List args) { Directory dataDir = Directory.fromUri( Platform.script.resolve('../../../_fe_analyzer_shared/test/inference/' 'type_constraint_generation/data')); diff --git a/pkg/analyzer/test/id_tests/type_promotion_test.dart b/pkg/analyzer/test/id_tests/type_promotion_test.dart index 1b1e1fa5dce9..7de4a45ca2f2 100644 --- a/pkg/analyzer/test/id_tests/type_promotion_test.dart +++ b/pkg/analyzer/test/id_tests/type_promotion_test.dart @@ -14,7 +14,7 @@ import 'package:analyzer/src/util/ast_data_extractor.dart'; import '../util/id_testing_helper.dart'; -main(List args) async { +main(List args) { Directory dataDir = Directory.fromUri(Platform.script .resolve('../../../_fe_analyzer_shared/test/flow_analysis/type_promotion/' 'data')); diff --git a/pkg/analyzer/test/id_tests/why_not_promoted_test.dart b/pkg/analyzer/test/id_tests/why_not_promoted_test.dart index 60992405ad01..1625fb1a68eb 100644 --- a/pkg/analyzer/test/id_tests/why_not_promoted_test.dart +++ b/pkg/analyzer/test/id_tests/why_not_promoted_test.dart @@ -13,7 +13,7 @@ import 'package:analyzer/src/util/ast_data_extractor.dart'; import '../util/id_testing_helper.dart'; -main(List args) async { +main(List args) { Directory dataDir = Directory.fromUri( Platform.script.resolve('../../../_fe_analyzer_shared/test/flow_analysis/' 'why_not_promoted/data')); diff --git a/pkg/analyzer/test/src/dart/micro/file_resolution.dart b/pkg/analyzer/test/src/dart/micro/file_resolution.dart index de33ec2a9d52..615fe0e8ddb5 100644 --- a/pkg/analyzer/test/src/dart/micro/file_resolution.dart +++ b/pkg/analyzer/test/src/dart/micro/file_resolution.dart @@ -117,7 +117,7 @@ class FileResolutionTest with ResourceProviderMixin, ResolutionTest { ); } - Future getTestErrors() async { + Future getTestErrors() { return fileResolver.getErrors2(path: testFile.path); } diff --git a/pkg/analyzer/test/src/summary/macro/code_generation.dart b/pkg/analyzer/test/src/summary/macro/code_generation.dart index fd879b5aee23..c6e3621e1103 100644 --- a/pkg/analyzer/test/src/summary/macro/code_generation.dart +++ b/pkg/analyzer/test/src/summary/macro/code_generation.dart @@ -13,14 +13,14 @@ import 'package:macros/macros.dart'; const AugmentForOmittedTypes(); @override - FutureOr buildDefinitionForField(declaration, builder) async { + FutureOr buildDefinitionForField(declaration, builder) { builder.augment( initializer: ExpressionCode.fromString('0'), ); } @override - FutureOr buildDefinitionForFunction(declaration, builder) async { + FutureOr buildDefinitionForFunction(declaration, builder) { builder.augment( FunctionBodyCode.fromString('{}'), ); @@ -149,7 +149,7 @@ import 'package:macros/macros.dart'; FutureOr buildDefinitionForMethod( MethodDeclaration method, FunctionDefinitionBuilder builder, - ) async { + ) { builder.augment( FunctionBodyCode.fromString("=> '${method.definingType.name}';"), ); diff --git a/pkg/analyzer/test/src/summary/macro/introspect.dart b/pkg/analyzer/test/src/summary/macro/introspect.dart index 8db283542954..a666f14e8d4c 100644 --- a/pkg/analyzer/test/src/summary/macro/introspect.dart +++ b/pkg/analyzer/test/src/summary/macro/introspect.dart @@ -397,7 +397,7 @@ class TreeStringSink { Future writeFlags(Map flags) async { if (flags.values.any((flag) => flag)) { - await writeIndentedLine(() async { + await writeIndentedLine(() { write('flags:'); for (var entry in flags.entries) { if (entry.value) { @@ -737,7 +737,7 @@ class _Printer { ExpressionCode code, { String? name, }) async { - await sink.writeIndentedLine(() async { + await sink.writeIndentedLine(() { if (name != null) { sink.write('$name: '); } diff --git a/pkg/analyzer/test/src/summary/macro/order.dart b/pkg/analyzer/test/src/summary/macro/order.dart index 30ad5dbe3049..51edc91c6b76 100644 --- a/pkg/analyzer/test/src/summary/macro/order.dart +++ b/pkg/analyzer/test/src/summary/macro/order.dart @@ -19,22 +19,22 @@ import 'package:macros/macros.dart'; const AddClass(this.name); @override - buildTypesForClass(clazz, builder) async { + buildTypesForClass(clazz, builder) { _add(builder); } @override - buildTypesForEnum(declaration, builder) async { + buildTypesForEnum(declaration, builder) { _add(builder); } @override - buildTypesForEnumValue(declaration, builder) async { + buildTypesForEnumValue(declaration, builder) { _add(builder); } @override - buildTypesForLibrary(declaration, builder) async { + buildTypesForLibrary(declaration, builder) { _add(builder); } @@ -64,7 +64,7 @@ import 'package:macros/macros.dart'; const AddFunction(this.name); @override - buildDeclarationsForClass(clazz, builder) async { + buildDeclarationsForClass(clazz, builder) { _add(builder); } diff --git a/pkg/analyzer/test/src/summary/macro/single/addClass_addMethod_addMethod.dart b/pkg/analyzer/test/src/summary/macro/single/addClass_addMethod_addMethod.dart index bae54626e825..59fa138a89bd 100644 --- a/pkg/analyzer/test/src/summary/macro/single/addClass_addMethod_addMethod.dart +++ b/pkg/analyzer/test/src/summary/macro/single/addClass_addMethod_addMethod.dart @@ -29,7 +29,7 @@ import 'package:macros/macros.dart'; const AddMethodBar(); @override - buildDeclarationsForMethod(method, builder) async { + buildDeclarationsForMethod(method, builder) { builder.declareInType( DeclarationCode.fromString(' void bar() {}'), ); diff --git a/pkg/analyzer/test/src/summary/macro_test.dart b/pkg/analyzer/test/src/summary/macro_test.dart index 2647faa0a37d..bff2563100a3 100644 --- a/pkg/analyzer/test/src/summary/macro_test.dart +++ b/pkg/analyzer/test/src/summary/macro_test.dart @@ -17452,7 +17452,7 @@ abstract class MacroTypesTest extends MacroElementsBaseTest { bool get retainDataForTesting => true; @override - Future tearDown() async { + Future tearDown() { for (var directory in _ioDirectoriesToDelete) { try { directory.deleteSync( diff --git a/pkg/analyzer_plugin/test/plugin/plugin_test.dart b/pkg/analyzer_plugin/test/plugin/plugin_test.dart index f98a6b7a9150..2b8f3131c8af 100644 --- a/pkg/analyzer_plugin/test/plugin/plugin_test.dart +++ b/pkg/analyzer_plugin/test/plugin/plugin_test.dart @@ -529,7 +529,7 @@ class _TestServerPlugin extends MockServerPlugin { @override Future afterNewContextCollection({ required AnalysisContextCollection contextCollection, - }) async { + }) { invoked_afterNewContextCollection = true; return super.afterNewContextCollection( contextCollection: contextCollection, diff --git a/pkg/analyzer_plugin/test/src/utilities/change_builder/change_builder_dart_test.dart b/pkg/analyzer_plugin/test/src/utilities/change_builder/change_builder_dart_test.dart index dbed86d6620c..5c06ae8c4df8 100644 --- a/pkg/analyzer_plugin/test/src/utilities/change_builder/change_builder_dart_test.dart +++ b/pkg/analyzer_plugin/test/src/utilities/change_builder/change_builder_dart_test.dart @@ -2171,7 +2171,7 @@ A''')); @reflectiveTest class DartFileEditBuilderImplTest extends AbstractContextTest with DartChangeBuilderMixin { - Future resolveContent(String path, String content) async { + Future resolveContent(String path, String content) { path = convertPath(path); addSource(path, content); return resolveFile(path); diff --git a/pkg/analyzer_plugin/test/utilities/completion/completion_contributor_util.dart b/pkg/analyzer_plugin/test/utilities/completion/completion_contributor_util.dart index cf3ea3e279fc..52f57d5fa5a5 100644 --- a/pkg/analyzer_plugin/test/utilities/completion/completion_contributor_util.dart +++ b/pkg/analyzer_plugin/test/utilities/completion/completion_contributor_util.dart @@ -476,7 +476,7 @@ abstract class DartCompletionContributorTest extends AbstractContextTest { return cs; } - Future performAnalysis(int times, Completer completer) async { + Future performAnalysis(int times, Completer completer) { if (completer.isCompleted) { return completer.future; }