CQ. Remove unnecessary 'async' where no 'await'.
Change-Id: Ic19aa901b0451d93f05cefc1d12d6e7fc6d58468 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403261 Commit-Queue: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
committed by
Commit Queue
parent
98befcf281
commit
125ef4373d
@@ -5,7 +5,7 @@
|
||||
import 'package:analysis_server/starter.dart';
|
||||
|
||||
/// Create and run an analysis server.
|
||||
void main(List<String> args) async {
|
||||
void main(List<String> args) {
|
||||
var starter = ServerStarter();
|
||||
starter.start(args);
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ class _TokenProgressReporter extends ProgressReporter {
|
||||
_sendNotification(WorkDoneProgressEnd(message: message));
|
||||
}
|
||||
|
||||
void _sendNotification(ToJsonable value) async {
|
||||
void _sendNotification(ToJsonable value) {
|
||||
_server.sendLspNotification(
|
||||
NotificationMessage(
|
||||
method: Method.progress,
|
||||
|
||||
@@ -877,10 +877,7 @@ void f(bar a) {}
|
||||
}
|
||||
|
||||
// Asserts that the results of the rename is the [expectedCode].
|
||||
void _assertTestChangeResult(
|
||||
String expectedCode,
|
||||
List<ReplaceInfo> changes,
|
||||
) async {
|
||||
void _assertTestChangeResult(String expectedCode, List<ReplaceInfo> changes) {
|
||||
var edits = <SourceEdit>[];
|
||||
for (var change in changes) {
|
||||
var offset =
|
||||
|
||||
@@ -22,7 +22,7 @@ import 'package:test_reflective_loader/test_reflective_loader.dart';
|
||||
import 'lint_rules.dart';
|
||||
import 'plugin_server_test_base.dart';
|
||||
|
||||
void main() async {
|
||||
void main() {
|
||||
defineReflectiveTests(PluginServerErrorTest);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import 'package:test_reflective_loader/test_reflective_loader.dart';
|
||||
import 'lint_rules.dart';
|
||||
import 'plugin_server_test_base.dart';
|
||||
|
||||
void main() async {
|
||||
void main() {
|
||||
defineReflectiveTests(PluginServerTest);
|
||||
}
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ class BlazeFileWatcherIsolate {
|
||||
|
||||
Future<void> get hasFinished => _hasFinished.future;
|
||||
|
||||
void handleRequest(dynamic request) async {
|
||||
void handleRequest(dynamic request) {
|
||||
if (request is BlazeWatcherStartWatching) {
|
||||
var workspaceData = _perWorkspaceData[request.workspace];
|
||||
if (workspaceData == null) {
|
||||
|
||||
@@ -394,7 +394,7 @@ var x = 0;
|
||||
|
||||
@reflectiveTest
|
||||
class FileSystemState_BlazeWorkspaceTest extends BlazeWorkspaceResolutionTest {
|
||||
void test_getFileForUri_hasGenerated_askGeneratedFirst() async {
|
||||
void test_getFileForUri_hasGenerated_askGeneratedFirst() {
|
||||
var relPath = 'dart/my/test/a.dart';
|
||||
var writablePath = convertPath('$workspaceRootPath/$relPath');
|
||||
var generatedPath = convertPath('$workspaceRootPath/blaze-bin/$relPath');
|
||||
@@ -422,7 +422,7 @@ class FileSystemState_BlazeWorkspaceTest extends BlazeWorkspaceResolutionTest {
|
||||
expect(writableFile2, same(generatedFile));
|
||||
}
|
||||
|
||||
void test_getFileForUri_hasGenerated_askWritableFirst() async {
|
||||
void test_getFileForUri_hasGenerated_askWritableFirst() {
|
||||
var relPath = 'dart/my/test/a.dart';
|
||||
var writablePath = convertPath('$workspaceRootPath/$relPath');
|
||||
var generatedPath = convertPath('$workspaceRootPath/blaze-bin/$relPath');
|
||||
@@ -450,7 +450,7 @@ class FileSystemState_BlazeWorkspaceTest extends BlazeWorkspaceResolutionTest {
|
||||
expect(writableFile2, same(generatedFile));
|
||||
}
|
||||
|
||||
void test_getFileForUri_nestedLib_notCanonicalUri() async {
|
||||
void test_getFileForUri_nestedLib_notCanonicalUri() {
|
||||
var outer = getFile('$workspaceRootPath/my/outer/lib/a.dart');
|
||||
var outerUri = Uri.parse('package:my.outer/a.dart');
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class AnalysisSessionImpl_BlazeWorkspaceTest
|
||||
expect(result.uri.toString(), 'package:dart.my/a.dart');
|
||||
}
|
||||
|
||||
void test_getParsedLibrary_notFileOfUri() async {
|
||||
void test_getParsedLibrary_notFileOfUri() {
|
||||
var relPath = 'dart/my/lib/a.dart';
|
||||
newFile('$workspaceRootPath/blaze-bin/$relPath', '');
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ class LibraryElementTest_featureSet extends PubPackageResolutionTest {
|
||||
void _assertLanguageVersion({
|
||||
required Version package,
|
||||
required Version? override,
|
||||
}) async {
|
||||
}) {
|
||||
var element = result.libraryElement2;
|
||||
expect(element.languageVersion.package, package);
|
||||
expect(element.languageVersion.override, override);
|
||||
|
||||
@@ -33,7 +33,7 @@ class InvalidExportOfInternalElement_BlazePackageTest
|
||||
String get testPackageLibPath => myPackageLibPath;
|
||||
|
||||
@override
|
||||
void setUp() async {
|
||||
void setUp() {
|
||||
super.setUp();
|
||||
addMeta();
|
||||
newFile('$testPackageBlazeBinPath/my.packages', '');
|
||||
@@ -279,7 +279,7 @@ export 'package:test/src/foo.dart';
|
||||
class InvalidExportOfInternalElement_PubPackageTest
|
||||
extends PubPackageResolutionTest with InvalidExportOfInternalElementTest {
|
||||
@override
|
||||
void setUp() async {
|
||||
void setUp() {
|
||||
super.setUp();
|
||||
writeTestPackageConfigWithMeta();
|
||||
newPubspecYamlFile(testPackageRootPath, r'''
|
||||
|
||||
@@ -18,7 +18,7 @@ class InvalidInternalAnnotationTest extends PubPackageResolutionTest {
|
||||
String get testPackageLibSrcFilePath => '$testPackageLibPath/src/foo.dart';
|
||||
|
||||
@override
|
||||
void setUp() async {
|
||||
void setUp() {
|
||||
super.setUp();
|
||||
writeTestPackageConfigWithMeta();
|
||||
newPubspecYamlFile(testPackageRootPath, r'''
|
||||
|
||||
@@ -476,7 +476,7 @@ class OptionsProviderTest with ResourceProviderMixin {
|
||||
}
|
||||
|
||||
void assertErrorsInOptionsFile(
|
||||
String code, List<ExpectedError> expectedErrors) async {
|
||||
String code, List<ExpectedError> expectedErrors) {
|
||||
newFile(optionsFilePath, code);
|
||||
var errors = analyzeAnalysisOptions(
|
||||
sourceFactory.forUri2(toUri(optionsFilePath))!,
|
||||
|
||||
@@ -210,7 +210,7 @@ language = struct(
|
||||
void _assertLanguageVersion({
|
||||
required Version package,
|
||||
required Version? override,
|
||||
}) async {
|
||||
}) {
|
||||
var element = result.libraryElement2;
|
||||
expect(element.languageVersion.package, package);
|
||||
expect(element.languageVersion.override, override);
|
||||
|
||||
@@ -24,7 +24,7 @@ main() {
|
||||
class BlazeWatcherTest with ResourceProviderMixin {
|
||||
late final BlazeWorkspace workspace;
|
||||
|
||||
void test_blazeFileWatcher() async {
|
||||
void test_blazeFileWatcher() {
|
||||
_addResources([
|
||||
'/workspace/${file_paths.blazeWorkspaceMarker}',
|
||||
]);
|
||||
@@ -235,7 +235,7 @@ class BlazeWatcherTest with ResourceProviderMixin {
|
||||
recPort.close();
|
||||
}
|
||||
|
||||
void test_blazeFileWatcherWithFolder() async {
|
||||
void test_blazeFileWatcherWithFolder() {
|
||||
_addResources([
|
||||
'/workspace/${file_paths.blazeWorkspaceMarker}',
|
||||
]);
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'dart:io';
|
||||
|
||||
/// A simple command-line app that reads the content of a file containing the
|
||||
/// output from `test.py` and performs some simple analysis of it.
|
||||
void main(List<String> args) async {
|
||||
void main(List<String> args) {
|
||||
if (args.length != 1) {
|
||||
print('Usage: dart test_log_parser logFilePath');
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user