mirror of
https://github.com/dart-lang/sdk
synced 2024-07-20 09:54:38 +00:00
[analysis_server] Avoid Future-of-implicit-dynamic in tests
* 99% of these are `Future ` --> `Future<void> ` * There are some `test_` methods which declare a return type of `Future` which is non-idiomatic, I think, but in order to create a pragmatic consistency, I added `<void>` to the few test methods in these libraries. Later if we desire, we can remove all of the return types. * Also a few `Completer ` --> `Completer<void> ` and `Stream ` --> `Stream<Object?> ` * There are many remaining cases in `lib/` Change-Id: I41cd51bab6886788e15ac7065dd21e95e789d09f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287260 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Samuel Rawlins <srawlins@google.com>
This commit is contained in:
parent
55ddbe534a
commit
27984095de
|
@ -39,7 +39,7 @@ Widget build(BuildContext context) {
|
|||
|
||||
List<ClosingLabel>? lastLabels;
|
||||
|
||||
late Completer _labelsReceived;
|
||||
late Completer<void> _labelsReceived;
|
||||
|
||||
@override
|
||||
void processNotification(Notification notification) {
|
||||
|
@ -47,7 +47,7 @@ Widget build(BuildContext context) {
|
|||
var params = AnalysisClosingLabelsParams.fromNotification(notification);
|
||||
if (params.file == testFile.path) {
|
||||
lastLabels = params.labels;
|
||||
_labelsReceived.complete(null);
|
||||
_labelsReceived.complete();
|
||||
}
|
||||
} else if (notification.event == SERVER_NOTIFICATION_ERROR) {
|
||||
var params = ServerErrorParams.fromNotification(notification);
|
||||
|
|
|
@ -34,7 +34,7 @@ main async() {}
|
|||
|
||||
List<FoldingRegion>? lastRegions;
|
||||
|
||||
late Completer _regionsReceived;
|
||||
late Completer<void> _regionsReceived;
|
||||
|
||||
@override
|
||||
void processNotification(Notification notification) {
|
||||
|
@ -42,7 +42,7 @@ main async() {}
|
|||
var params = AnalysisFoldingParams.fromNotification(notification);
|
||||
if (params.file == testFile.path) {
|
||||
lastRegions = params.regions;
|
||||
_regionsReceived.complete(null);
|
||||
_regionsReceived.complete();
|
||||
}
|
||||
} else if (notification.event == SERVER_NOTIFICATION_ERROR) {
|
||||
var params = ServerErrorParams.fromNotification(notification);
|
||||
|
|
|
@ -526,8 +526,8 @@ class B extends A {
|
|||
assertNoImplementedMember('m() => 0');
|
||||
}
|
||||
|
||||
Future waitForImplementedElements() {
|
||||
Future waitForNotification(int times) {
|
||||
Future<void> waitForImplementedElements() {
|
||||
Future<void> waitForNotification(int times) {
|
||||
if (times == 0 || implementedClasses != null) {
|
||||
return Future.value();
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ class AnalysisNotificationOutlineTest extends PubPackageAnalysisServerTest {
|
|||
Outline? outline;
|
||||
|
||||
final Completer<void> _outlineReceived = Completer();
|
||||
Completer? _highlightsReceived = Completer();
|
||||
Completer<void>? _highlightsReceived = Completer();
|
||||
|
||||
Future<void> prepareOutline() async {
|
||||
await addAnalysisSubscription(AnalysisService.OUTLINE, testFile);
|
||||
|
@ -47,7 +47,7 @@ class AnalysisNotificationOutlineTest extends PubPackageAnalysisServerTest {
|
|||
if (notification.event == ANALYSIS_NOTIFICATION_HIGHLIGHTS) {
|
||||
var params = AnalysisHighlightsParams.fromNotification(notification);
|
||||
if (params.file == testFile.path) {
|
||||
_highlightsReceived?.complete(null);
|
||||
_highlightsReceived?.complete();
|
||||
_highlightsReceived = null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -114,10 +114,10 @@ class ByteStreamServerChannelTest {
|
|||
late Stream<Request> requestStream;
|
||||
|
||||
/// Stream of errors received from the channel via [listen()].
|
||||
late Stream errorStream;
|
||||
late Stream<Object?> errorStream;
|
||||
|
||||
/// Future which is completed when then [listen()] reports [onDone].
|
||||
late Future doneFuture;
|
||||
late Future<void> doneFuture;
|
||||
|
||||
void setUp() {
|
||||
var inputStream = StreamController<List<int>>();
|
||||
|
@ -131,7 +131,7 @@ class ByteStreamServerChannelTest {
|
|||
inputStream.stream, outputSink, InstrumentationService.NULL_SERVICE);
|
||||
var requestStreamController = StreamController<Request>();
|
||||
requestStream = requestStreamController.stream;
|
||||
var errorStreamController = StreamController();
|
||||
var errorStreamController = StreamController<Object?>();
|
||||
errorStream = errorStreamController.stream;
|
||||
var doneCompleter = Completer();
|
||||
doneFuture = doneCompleter.future;
|
||||
|
|
|
@ -26,7 +26,7 @@ class OrganizeDirectivesTest extends PubPackageAnalysisServerTest {
|
|||
}
|
||||
|
||||
@failingTest
|
||||
Future test_BAD_doesNotExist() async {
|
||||
Future<void> test_BAD_doesNotExist() async {
|
||||
// The analysis driver fails to return an error
|
||||
var request =
|
||||
EditOrganizeDirectivesParams(convertPath('/no/such/file.dart'))
|
||||
|
@ -39,7 +39,7 @@ class OrganizeDirectivesTest extends PubPackageAnalysisServerTest {
|
|||
);
|
||||
}
|
||||
|
||||
Future test_BAD_hasParseError() async {
|
||||
Future<void> test_BAD_hasParseError() async {
|
||||
addTestFile('''
|
||||
import 'dart:async'
|
||||
|
||||
|
@ -54,7 +54,7 @@ void f() {}
|
|||
);
|
||||
}
|
||||
|
||||
Future test_BAD_notDartFile() async {
|
||||
Future<void> test_BAD_notDartFile() async {
|
||||
var request = EditOrganizeDirectivesParams(
|
||||
convertPath('/not-a-Dart-file.txt'),
|
||||
).toRequest('0');
|
||||
|
@ -88,7 +88,7 @@ void f() {}
|
|||
);
|
||||
}
|
||||
|
||||
Future test_keep_unresolvedDirectives() {
|
||||
Future<void> test_keep_unresolvedDirectives() {
|
||||
var code = r'''
|
||||
import 'dart:noSuchImportSdkLibrary';
|
||||
|
||||
|
@ -104,7 +104,7 @@ part 'no_such_part.dart';
|
|||
return _assertOrganized(code);
|
||||
}
|
||||
|
||||
Future test_OK_remove_duplicateImports_withSamePrefix() {
|
||||
Future<void> test_OK_remove_duplicateImports_withSamePrefix() {
|
||||
addTestFile('''
|
||||
library lib;
|
||||
|
||||
|
@ -126,7 +126,7 @@ void f() {
|
|||
''');
|
||||
}
|
||||
|
||||
Future test_OK_remove_unusedImports() {
|
||||
Future<void> test_OK_remove_unusedImports() {
|
||||
addTestFile('''
|
||||
library lib;
|
||||
|
||||
|
@ -153,13 +153,13 @@ void f() {
|
|||
''');
|
||||
}
|
||||
|
||||
Future _assertOrganized(String expectedCode) async {
|
||||
Future<void> _assertOrganized(String expectedCode) async {
|
||||
await _requestOrganize();
|
||||
var resultCode = SourceEdit.applySequence(testFileContent, fileEdit.edits);
|
||||
expect(resultCode, expectedCode);
|
||||
}
|
||||
|
||||
Future _requestOrganize() async {
|
||||
Future<void> _requestOrganize() async {
|
||||
var request = EditOrganizeDirectivesParams(testFile.path).toRequest('0');
|
||||
var response = await handleSuccessfulRequest(request);
|
||||
var result = EditOrganizeDirectivesResult.fromResponse(response);
|
||||
|
|
|
@ -810,7 +810,7 @@ int? res(int b) {
|
|||
return result.feedback as ExtractMethodFeedback;
|
||||
}
|
||||
|
||||
Future _prepareOptions() {
|
||||
Future<void> _prepareOptions() {
|
||||
return getRefactoringResult(() {
|
||||
// get initial feedback
|
||||
return _sendExtractRequest();
|
||||
|
@ -855,7 +855,7 @@ class GetAvailableRefactoringsTest extends PubPackageAnalysisServerTest {
|
|||
|
||||
/// Tests that there is refactoring of the given [kind] is available at the
|
||||
/// [search] offset.
|
||||
Future assertHasKind(
|
||||
Future<void> assertHasKind(
|
||||
String code, String search, RefactoringKind kind, bool expected) async {
|
||||
addTestFile(code);
|
||||
await waitForTasksFinished();
|
||||
|
@ -869,13 +869,13 @@ class GetAvailableRefactoringsTest extends PubPackageAnalysisServerTest {
|
|||
}
|
||||
|
||||
/// Tests that there is a RENAME refactoring available at the [search] offset.
|
||||
Future assertHasRenameRefactoring(String code, String search) async {
|
||||
Future<void> assertHasRenameRefactoring(String code, String search) async {
|
||||
return assertHasKind(code, search, RefactoringKind.RENAME, true);
|
||||
}
|
||||
|
||||
/// Returns the list of available refactorings for the given [offset] and
|
||||
/// [length].
|
||||
Future getRefactorings(int offset, int length) async {
|
||||
Future<void> getRefactorings(int offset, int length) async {
|
||||
var request =
|
||||
EditGetAvailableRefactoringsParams(testFile.path, offset, length)
|
||||
.toRequest('0');
|
||||
|
@ -885,12 +885,12 @@ class GetAvailableRefactoringsTest extends PubPackageAnalysisServerTest {
|
|||
}
|
||||
|
||||
/// Returns the list of available refactorings at the offset of [search].
|
||||
Future getRefactoringsAtString(String search) {
|
||||
Future<void> getRefactoringsAtString(String search) {
|
||||
var offset = findOffset(search);
|
||||
return getRefactorings(offset, 0);
|
||||
}
|
||||
|
||||
Future getRefactoringsForString(String search) {
|
||||
Future<void> getRefactoringsForString(String search) {
|
||||
var offset = findOffset(search);
|
||||
return getRefactorings(offset, search.length);
|
||||
}
|
||||
|
@ -901,13 +901,13 @@ class GetAvailableRefactoringsTest extends PubPackageAnalysisServerTest {
|
|||
await setRoots(included: [workspaceRootPath], excluded: []);
|
||||
}
|
||||
|
||||
Future test_convertMethodToGetter_hasElement() {
|
||||
Future<void> test_convertMethodToGetter_hasElement() {
|
||||
return assertHasKind('''
|
||||
int getValue() => 42;
|
||||
''', 'getValue', RefactoringKind.CONVERT_METHOD_TO_GETTER, true);
|
||||
}
|
||||
|
||||
Future test_extractLocal() async {
|
||||
Future<void> test_extractLocal() async {
|
||||
addTestFile('''
|
||||
void f() {
|
||||
var a = 1 + 2;
|
||||
|
@ -919,7 +919,7 @@ void f() {
|
|||
expect(kinds, contains(RefactoringKind.EXTRACT_METHOD));
|
||||
}
|
||||
|
||||
Future test_extractLocal_withoutSelection() async {
|
||||
Future<void> test_extractLocal_withoutSelection() async {
|
||||
addTestFile('''
|
||||
void f() {
|
||||
var a = 1 + 2;
|
||||
|
@ -931,7 +931,7 @@ void f() {
|
|||
expect(kinds, contains(RefactoringKind.EXTRACT_METHOD));
|
||||
}
|
||||
|
||||
Future test_extractWidget() async {
|
||||
Future<void> test_extractWidget() async {
|
||||
addFlutterPackage();
|
||||
addTestFile('''
|
||||
import 'package:flutter/material.dart';
|
||||
|
@ -971,7 +971,7 @@ class MyWidget extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
|
||||
Future test_rename_hasElement_class() {
|
||||
Future<void> test_rename_hasElement_class() {
|
||||
return assertHasRenameRefactoring('''
|
||||
class Test {}
|
||||
void f() {
|
||||
|
@ -980,7 +980,7 @@ void f() {
|
|||
''', 'Test v');
|
||||
}
|
||||
|
||||
Future test_rename_hasElement_constructor() {
|
||||
Future<void> test_rename_hasElement_constructor() {
|
||||
return assertHasRenameRefactoring('''
|
||||
class A {
|
||||
A.test() {}
|
||||
|
@ -991,7 +991,7 @@ void f() {
|
|||
''', 'test();');
|
||||
}
|
||||
|
||||
Future test_rename_hasElement_function() {
|
||||
Future<void> test_rename_hasElement_function() {
|
||||
return assertHasRenameRefactoring('''
|
||||
void f() {
|
||||
test();
|
||||
|
@ -1000,7 +1000,7 @@ test() {}
|
|||
''', 'test();');
|
||||
}
|
||||
|
||||
Future test_rename_hasElement_importElement_directive() {
|
||||
Future<void> test_rename_hasElement_importElement_directive() {
|
||||
return assertHasRenameRefactoring('''
|
||||
import 'dart:math' as math;
|
||||
void f() {
|
||||
|
@ -1009,7 +1009,7 @@ void f() {
|
|||
''', 'import ');
|
||||
}
|
||||
|
||||
Future test_rename_hasElement_importElement_prefixDecl() {
|
||||
Future<void> test_rename_hasElement_importElement_prefixDecl() {
|
||||
return assertHasRenameRefactoring('''
|
||||
import 'dart:math' as math;
|
||||
void f() {
|
||||
|
@ -1018,7 +1018,7 @@ void f() {
|
|||
''', 'math;');
|
||||
}
|
||||
|
||||
Future test_rename_hasElement_importElement_prefixRef() {
|
||||
Future<void> test_rename_hasElement_importElement_prefixRef() {
|
||||
return assertHasRenameRefactoring('''
|
||||
import 'dart:async' as test;
|
||||
import 'dart:math' as test;
|
||||
|
@ -1028,7 +1028,7 @@ void f() {
|
|||
''', 'test.pi;');
|
||||
}
|
||||
|
||||
Future test_rename_hasElement_instanceGetter() {
|
||||
Future<void> test_rename_hasElement_instanceGetter() {
|
||||
return assertHasRenameRefactoring('''
|
||||
class A {
|
||||
get test => 0;
|
||||
|
@ -1039,7 +1039,7 @@ void f(A a) {
|
|||
''', 'test;');
|
||||
}
|
||||
|
||||
Future test_rename_hasElement_instanceSetter() {
|
||||
Future<void> test_rename_hasElement_instanceSetter() {
|
||||
return assertHasRenameRefactoring('''
|
||||
class A {
|
||||
set test(x) {}
|
||||
|
@ -1050,13 +1050,13 @@ void f(A a) {
|
|||
''', 'test = 2;');
|
||||
}
|
||||
|
||||
Future test_rename_hasElement_library() {
|
||||
Future<void> test_rename_hasElement_library() {
|
||||
return assertHasRenameRefactoring('''
|
||||
library my.lib;
|
||||
''', 'library ');
|
||||
}
|
||||
|
||||
Future test_rename_hasElement_localVariable() {
|
||||
Future<void> test_rename_hasElement_localVariable() {
|
||||
return assertHasRenameRefactoring('''
|
||||
void f() {
|
||||
int test = 0;
|
||||
|
@ -1065,7 +1065,7 @@ void f() {
|
|||
''', 'test = 0;');
|
||||
}
|
||||
|
||||
Future test_rename_hasElement_method() {
|
||||
Future<void> test_rename_hasElement_method() {
|
||||
return assertHasRenameRefactoring('''
|
||||
class A {
|
||||
test() {}
|
||||
|
@ -1076,7 +1076,7 @@ void f(A a) {
|
|||
''', 'test();');
|
||||
}
|
||||
|
||||
Future test_rename_noElement() async {
|
||||
Future<void> test_rename_noElement() async {
|
||||
addTestFile('''
|
||||
void f() {
|
||||
// not an element
|
||||
|
@ -2484,7 +2484,7 @@ void f() {
|
|||
class _AbstractGetRefactoring_Test extends PubPackageAnalysisServerTest {
|
||||
bool shouldWaitForFullAnalysis = true;
|
||||
|
||||
Future assertEmptySuccessfulRefactoring(
|
||||
Future<void> assertEmptySuccessfulRefactoring(
|
||||
Future<Response> Function() requestSender,
|
||||
{void Function(RefactoringFeedback?)? feedbackValidator}) async {
|
||||
var result = await getRefactoringResult(requestSender);
|
||||
|
@ -2546,7 +2546,7 @@ class _AbstractGetRefactoring_Test extends PubPackageAnalysisServerTest {
|
|||
}
|
||||
}
|
||||
|
||||
Future assertSuccessfulRefactoring(
|
||||
Future<void> assertSuccessfulRefactoring(
|
||||
Future<Response> Function() requestSender, String expectedCode,
|
||||
{void Function(RefactoringFeedback?)? feedbackValidator}) async {
|
||||
var result = await getRefactoringResult(requestSender);
|
||||
|
|
|
@ -262,13 +262,13 @@ class C {}
|
|||
''');
|
||||
}
|
||||
|
||||
Future _assertSorted(String expectedCode) async {
|
||||
Future<void> _assertSorted(String expectedCode) async {
|
||||
await _requestSort();
|
||||
var resultCode = SourceEdit.applySequence(testFileContent, fileEdit.edits);
|
||||
expect(resultCode, expectedCode);
|
||||
}
|
||||
|
||||
Future _requestSort() async {
|
||||
Future<void> _requestSort() async {
|
||||
var request = EditSortMembersParams(testFile.path).toRequest('0');
|
||||
var response = await handleSuccessfulRequest(request);
|
||||
var result = EditSortMembersResult.fromResponse(response);
|
||||
|
|
|
@ -111,7 +111,7 @@ final LIBRARIES = const <String, LibraryInfo> {
|
|||
}
|
||||
|
||||
@override
|
||||
Future startServer({int? diagnosticPort, int? servicePort}) {
|
||||
Future<void> startServer({int? diagnosticPort, int? servicePort}) {
|
||||
var sdkPath = createNonStandardSdk();
|
||||
return server.start(
|
||||
diagnosticPort: diagnosticPort,
|
||||
|
@ -119,7 +119,7 @@ final LIBRARIES = const <String, LibraryInfo> {
|
|||
servicePort: servicePort);
|
||||
}
|
||||
|
||||
Future test_getErrors() async {
|
||||
Future<void> test_getErrors() async {
|
||||
var pathname = sourcePath('test.dart');
|
||||
var text = r'''
|
||||
import 'dart:core';
|
||||
|
|
|
@ -117,7 +117,7 @@ void f() {
|
|||
|
||||
/// Check that a getHover request on the substring [target] produces no
|
||||
/// results.
|
||||
Future checkNoHover(String target) {
|
||||
Future<void> checkNoHover(String target) {
|
||||
var offset = text.indexOf(target);
|
||||
return sendAnalysisGetHover(pathname, offset).then((result) {
|
||||
expect(result.hovers, hasLength(0));
|
||||
|
|
|
@ -47,7 +47,7 @@ class AnalysisHighlightsTest extends AbstractAnalysisServerIntegrationTest {
|
|||
}
|
||||
|
||||
@override
|
||||
Future startServer({
|
||||
Future<void> startServer({
|
||||
int? diagnosticPort,
|
||||
int? servicePort,
|
||||
}) {
|
||||
|
|
|
@ -72,7 +72,7 @@ class AnalysisGetImportElementsIntegrationTest
|
|||
}
|
||||
|
||||
@override
|
||||
Future setUp() async {
|
||||
Future<void> setUp() async {
|
||||
await super.setUp();
|
||||
pathname = sourcePath('test.dart');
|
||||
}
|
||||
|
|
|
@ -140,7 +140,7 @@ class LspServerClient {
|
|||
return dirname(pathname);
|
||||
}
|
||||
|
||||
Future start({
|
||||
Future<void> start({
|
||||
required String dartSdkPath,
|
||||
List<String>? vmArgs,
|
||||
}) async {
|
||||
|
|
|
@ -20,7 +20,7 @@ class GetTypeHierarchyTest extends AbstractAnalysisServerIntegrationTest {
|
|||
/// Pathname of the main file to run tests in.
|
||||
late String pathname;
|
||||
|
||||
Future getTypeHierarchy_badTarget() async {
|
||||
Future<void> getTypeHierarchy_badTarget() async {
|
||||
var text = r'''
|
||||
void f() {
|
||||
if /* target */ (true) {
|
||||
|
@ -61,7 +61,7 @@ class Derived extends Pivot {}
|
|||
});
|
||||
}
|
||||
|
||||
Future getTypeHierarchy_displayName() {
|
||||
Future<void> getTypeHierarchy_displayName() {
|
||||
var text = r'''
|
||||
class Base<T> {}
|
||||
class Pivot /* target */ extends Base<int> {}
|
||||
|
@ -74,7 +74,7 @@ class Pivot /* target */ extends Base<int> {}
|
|||
});
|
||||
}
|
||||
|
||||
Future getTypeHierarchy_functionTarget() async {
|
||||
Future<void> getTypeHierarchy_functionTarget() async {
|
||||
var text = r'''
|
||||
main /* target */ () {
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ main /* target */ () {
|
|||
expect(results, isNull);
|
||||
}
|
||||
|
||||
Future getTypeHierarchy_interfaces() {
|
||||
Future<void> getTypeHierarchy_interfaces() {
|
||||
var text = r'''
|
||||
class Interface1 {}
|
||||
class Interface2 {}
|
||||
|
@ -102,7 +102,7 @@ class Pivot /* target */ implements Interface1, Interface2 {}
|
|||
});
|
||||
}
|
||||
|
||||
Future getTypeHierarchy_memberElement() {
|
||||
Future<void> getTypeHierarchy_memberElement() {
|
||||
var text = r'''
|
||||
class Base1 {
|
||||
void foo /* base1 */ ();
|
||||
|
@ -129,7 +129,7 @@ class Derived2 extends Derived1 {
|
|||
});
|
||||
}
|
||||
|
||||
Future getTypeHierarchy_mixins() {
|
||||
Future<void> getTypeHierarchy_mixins() {
|
||||
var text = r'''
|
||||
class Base {}
|
||||
class Mixin1 {}
|
||||
|
@ -148,7 +148,7 @@ class Pivot /* target */ extends Base with Mixin1, Mixin2 {}
|
|||
});
|
||||
}
|
||||
|
||||
Future getTypeHierarchy_subclasses() {
|
||||
Future<void> getTypeHierarchy_subclasses() {
|
||||
var text = r'''
|
||||
class Base {}
|
||||
class Pivot /* target */ extends Base {}
|
||||
|
@ -170,7 +170,7 @@ class Sub2a extends Sub2 {}
|
|||
});
|
||||
}
|
||||
|
||||
Future getTypeHierarchy_superclass() {
|
||||
Future<void> getTypeHierarchy_superclass() {
|
||||
var text = r'''
|
||||
class Base1 {}
|
||||
class Base2 extends Base1 {}
|
||||
|
|
|
@ -48,7 +48,7 @@ class BlazeChangesTest extends AbstractAnalysisServerIntegrationTest {
|
|||
path.join(workspacePath, relative.replaceAll('/', path.separator));
|
||||
|
||||
@override
|
||||
Future setUp() async {
|
||||
Future<void> setUp() async {
|
||||
await super.setUp();
|
||||
oldSourceDirectory = sourceDirectory;
|
||||
|
||||
|
@ -78,7 +78,7 @@ class BlazeChangesTest extends AbstractAnalysisServerIntegrationTest {
|
|||
}
|
||||
|
||||
@override
|
||||
Future tearDown() async {
|
||||
Future<void> tearDown() async {
|
||||
Directory(tmpPath).deleteSync(recursive: true);
|
||||
sourceDirectory = oldSourceDirectory;
|
||||
await super.tearDown();
|
||||
|
|
|
@ -20,7 +20,7 @@ void main() {
|
|||
class OptionsPackagesIntegrationTest
|
||||
extends AbstractAnalysisServerIntegrationTest {
|
||||
@override
|
||||
Future startServer({int? diagnosticPort, int? servicePort}) {
|
||||
Future<void> startServer({int? diagnosticPort, int? servicePort}) {
|
||||
var fooPath = sourcePath('foo');
|
||||
writeFile(
|
||||
path.join(fooPath, 'lib', 'foo.dart'),
|
||||
|
|
|
@ -155,14 +155,14 @@ abstract class AbstractAnalysisServerIntegrationTest extends IntegrationTest {
|
|||
String readFile(String pathname) => File(pathname).readAsStringSync();
|
||||
|
||||
@override
|
||||
Future sendServerSetSubscriptions(List<ServerService> subscriptions) {
|
||||
Future<void> sendServerSetSubscriptions(List<ServerService> subscriptions) {
|
||||
_subscribedToServerStatus = subscriptions.contains(ServerService.STATUS);
|
||||
return super.sendServerSetSubscriptions(subscriptions);
|
||||
}
|
||||
|
||||
/// The server is automatically started before every test, and a temporary
|
||||
/// [sourceDirectory] is created.
|
||||
Future setUp() async {
|
||||
Future<void> setUp() async {
|
||||
sourceDirectory = Directory(Directory.systemTemp
|
||||
.createTempSync('analysisServer')
|
||||
.resolveSymbolicLinksSync());
|
||||
|
@ -192,7 +192,7 @@ abstract class AbstractAnalysisServerIntegrationTest extends IntegrationTest {
|
|||
}
|
||||
|
||||
/// If [skipShutdown] is not set, shut down the server.
|
||||
Future shutdownIfNeeded() {
|
||||
Future<void> shutdownIfNeeded() {
|
||||
if (skipShutdown) {
|
||||
return Future.value();
|
||||
}
|
||||
|
@ -218,8 +218,8 @@ abstract class AbstractAnalysisServerIntegrationTest extends IntegrationTest {
|
|||
/// analyze [sourceDirectory]. If [subscribeStatus] is true (the default),
|
||||
/// then also enable [SERVER_NOTIFICATION_STATUS] notifications so that
|
||||
/// [analysisFinished] can be used.
|
||||
Future standardAnalysisSetup({bool subscribeStatus = true}) {
|
||||
var futures = <Future>[];
|
||||
Future<void> standardAnalysisSetup({bool subscribeStatus = true}) {
|
||||
var futures = <Future<void>>[];
|
||||
if (subscribeStatus) {
|
||||
futures.add(sendServerSetSubscriptions([ServerService.STATUS]));
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ abstract class AbstractAnalysisServerIntegrationTest extends IntegrationTest {
|
|||
}
|
||||
|
||||
/// Start [server].
|
||||
Future startServer({
|
||||
Future<void> startServer({
|
||||
int? diagnosticPort,
|
||||
int? servicePort,
|
||||
}) {
|
||||
|
@ -240,7 +240,7 @@ abstract class AbstractAnalysisServerIntegrationTest extends IntegrationTest {
|
|||
}
|
||||
|
||||
/// After every test, the server is stopped and [sourceDirectory] is deleted.
|
||||
Future tearDown() {
|
||||
Future<void> tearDown() {
|
||||
return shutdownIfNeeded().then((_) {
|
||||
sourceDirectory.deleteSync(recursive: true);
|
||||
});
|
||||
|
@ -496,7 +496,7 @@ class Server {
|
|||
|
||||
/// Return a future that will complete when all commands that have been sent
|
||||
/// to the server so far have been flushed to the OS buffer.
|
||||
Future flushCommands() {
|
||||
Future<void> flushCommands() {
|
||||
return _process.stdin.flush();
|
||||
}
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ abstract class AbstractCodeActionsTest extends AbstractLspAnalysisServerTest {
|
|||
/// Verifies that executing the given code actions command on the server
|
||||
/// results in an edit being sent to the client that updates the file to match
|
||||
/// the expected content.
|
||||
Future verifyCodeActionEdits(Either2<Command, CodeAction> codeAction,
|
||||
Future<void> verifyCodeActionEdits(Either2<Command, CodeAction> codeAction,
|
||||
String content, String expectedContent,
|
||||
{bool expectDocumentChanges = false,
|
||||
ProgressToken? workDoneToken}) async {
|
||||
|
|
|
@ -165,7 +165,8 @@ abstract class AbstractLspAnalysisServerTest
|
|||
}
|
||||
|
||||
@override
|
||||
Future sendNotificationToServer(NotificationMessage notification) async {
|
||||
Future<void> sendNotificationToServer(
|
||||
NotificationMessage notification) async {
|
||||
channel.sendNotificationToServer(notification);
|
||||
await pumpEventQueue(times: 5000);
|
||||
}
|
||||
|
@ -228,7 +229,7 @@ analyzer:
|
|||
writePackageConfig(projectFolderPath);
|
||||
}
|
||||
|
||||
Future tearDown() async {
|
||||
Future<void> tearDown() async {
|
||||
channel.close();
|
||||
await server.shutdown();
|
||||
}
|
||||
|
@ -915,7 +916,7 @@ mixin LspAnalysisServerTestMixin implements ClientCapabilitiesHelperMixin {
|
|||
request, _fromJsonList(CallHierarchyOutgoingCall.fromJson));
|
||||
}
|
||||
|
||||
Future changeFile(
|
||||
Future<void> changeFile(
|
||||
int newVersion,
|
||||
Uri uri,
|
||||
List<TextDocumentContentChangeEvent> changes,
|
||||
|
@ -931,7 +932,8 @@ mixin LspAnalysisServerTestMixin implements ClientCapabilitiesHelperMixin {
|
|||
await sendNotificationToServer(notification);
|
||||
}
|
||||
|
||||
Future changeWorkspaceFolders({List<Uri>? add, List<Uri>? remove}) async {
|
||||
Future<void> changeWorkspaceFolders(
|
||||
{List<Uri>? add, List<Uri>? remove}) async {
|
||||
var notification = makeNotification(
|
||||
Method.workspace_didChangeWorkspaceFolders,
|
||||
DidChangeWorkspaceFoldersParams(
|
||||
|
@ -944,7 +946,7 @@ mixin LspAnalysisServerTestMixin implements ClientCapabilitiesHelperMixin {
|
|||
await sendNotificationToServer(notification);
|
||||
}
|
||||
|
||||
Future closeFile(Uri uri) async {
|
||||
Future<void> closeFile(Uri uri) async {
|
||||
var notification = makeNotification(
|
||||
Method.textDocument_didClose,
|
||||
DidCloseTextDocumentParams(
|
||||
|
@ -1698,7 +1700,7 @@ mixin LspAnalysisServerTestMixin implements ClientCapabilitiesHelperMixin {
|
|||
return expectSuccessfulResponseTo(request, WorkspaceEdit.fromJson);
|
||||
}
|
||||
|
||||
Future openFile(Uri uri, String content, {int version = 1}) async {
|
||||
Future<void> openFile(Uri uri, String content, {int version = 1}) async {
|
||||
var notification = makeNotification(
|
||||
Method.textDocument_didOpen,
|
||||
DidOpenTextDocumentParams(
|
||||
|
@ -1903,7 +1905,7 @@ mixin LspAnalysisServerTestMixin implements ClientCapabilitiesHelperMixin {
|
|||
return sendRequestToServer(request);
|
||||
}
|
||||
|
||||
Future replaceFile(int newVersion, Uri uri, String content) {
|
||||
Future<void> replaceFile(int newVersion, Uri uri, String content) {
|
||||
return changeFile(
|
||||
newVersion,
|
||||
uri,
|
||||
|
|
|
@ -16,7 +16,7 @@ class MockLspServerChannel implements LspServerCommunicationChannel {
|
|||
StreamController<lsp.Message>.broadcast();
|
||||
|
||||
/// Completer that will be signalled when the input stream is closed.
|
||||
final Completer _closed = Completer();
|
||||
final Completer<void> _closed = Completer();
|
||||
|
||||
/// Errors popups sent to the user.
|
||||
final shownErrors = <lsp.ShowMessageParams>[];
|
||||
|
@ -51,7 +51,7 @@ class MockLspServerChannel implements LspServerCommunicationChannel {
|
|||
|
||||
/// Future that will be completed when the input stream is closed.
|
||||
@override
|
||||
Future get closed {
|
||||
Future<void> get closed {
|
||||
return _closed.future;
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ class AbstractSearchDomainTest extends PubPackageAnalysisServerTest {
|
|||
await setRoots(included: [workspaceRootPath], excluded: []);
|
||||
}
|
||||
|
||||
Future waitForSearchResults() {
|
||||
Future<void> waitForSearchResults() {
|
||||
var resultSet = _resultSets[searchId];
|
||||
if (resultSet != null && resultSet.done) {
|
||||
results = resultSet.results;
|
||||
|
|
|
@ -25,7 +25,7 @@ class MemberDeclarationsTest extends AbstractSearchDomainTest {
|
|||
this.result = result;
|
||||
}
|
||||
|
||||
Future findMemberDeclarations(String name) async {
|
||||
Future<void> findMemberDeclarations(String name) async {
|
||||
await waitForTasksFinished();
|
||||
var request = SearchFindMemberDeclarationsParams(name).toRequest('0');
|
||||
var response = await handleSuccessfulRequest(request);
|
||||
|
|
|
@ -21,7 +21,7 @@ class MemberReferencesTest extends AbstractSearchDomainTest {
|
|||
expect(result.isPotential, isPotential);
|
||||
}
|
||||
|
||||
Future findMemberReferences(String name) async {
|
||||
Future<void> findMemberReferences(String name) async {
|
||||
await waitForTasksFinished();
|
||||
var request = SearchFindMemberReferencesParams(name).toRequest('0');
|
||||
var response = await handleSuccessfulRequest(request);
|
||||
|
|
|
@ -32,7 +32,8 @@ class TopLevelDeclarationsTest extends AbstractSearchDomainTest {
|
|||
}
|
||||
}
|
||||
|
||||
Future findTopLevelDeclarations(String pattern) async {
|
||||
Future<dynamic /*RequestError?|void*/ > findTopLevelDeclarations(
|
||||
String pattern) async {
|
||||
await waitForTasksFinished();
|
||||
var request = SearchFindTopLevelDeclarationsParams(pattern).toRequest('0');
|
||||
var response = await handleRequest(request);
|
||||
|
|
|
@ -560,7 +560,7 @@ abstract class _BaseDartCompletionContributorTest extends AbstractContextTest {
|
|||
Future<List<CompletionSuggestion>> computeContributedSuggestions(
|
||||
DartCompletionRequest request);
|
||||
|
||||
Future computeSuggestions({int times = 200}) async {
|
||||
Future<void> computeSuggestions({int times = 200}) async {
|
||||
result = await getResolvedUnit(testFile);
|
||||
|
||||
// Build the request
|
||||
|
|
|
@ -28,7 +28,7 @@ class TypeMemberContributorTest extends DartCompletionContributorTest {
|
|||
/// shadows a declaration of the form [shadowee] in a base class, for the
|
||||
/// purposes of what is shown during completion. [shouldBeShadowed] indicates
|
||||
/// whether shadowing is expected.
|
||||
Future check_shadowing(
|
||||
Future<void> check_shadowing(
|
||||
String shadower, String shadowee, bool shouldBeShadowed) async {
|
||||
addTestSource('''
|
||||
class Base {
|
||||
|
|
|
@ -62,7 +62,7 @@ abstract class RefactoringTest extends AbstractSingleUnitTest {
|
|||
}
|
||||
|
||||
/// Asserts that [refactoring] initial/final conditions status is OK.
|
||||
Future assertRefactoringConditionsOK() async {
|
||||
Future<void> assertRefactoringConditionsOK() async {
|
||||
var status = await refactoring.checkInitialConditions();
|
||||
assertRefactoringStatusOK(status);
|
||||
status = await refactoring.checkFinalConditions();
|
||||
|
@ -70,7 +70,7 @@ abstract class RefactoringTest extends AbstractSingleUnitTest {
|
|||
}
|
||||
|
||||
/// Asserts that [refactoring] final conditions status is OK.
|
||||
Future assertRefactoringFinalConditionsOK() async {
|
||||
Future<void> assertRefactoringFinalConditionsOK() async {
|
||||
var status = await refactoring.checkFinalConditions();
|
||||
assertRefactoringStatusOK(status);
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ abstract class RefactoringTest extends AbstractSingleUnitTest {
|
|||
|
||||
/// Checks that all conditions of [refactoring] are OK and the result of
|
||||
/// applying the [Change] to [testUnit] is [expectedCode].
|
||||
Future assertSuccessfulRefactoring(String expectedCode) async {
|
||||
Future<void> assertSuccessfulRefactoring(String expectedCode) async {
|
||||
await assertRefactoringConditionsOK();
|
||||
var change = await refactoring.createChange();
|
||||
refactoringChange = change;
|
||||
|
|
|
@ -174,7 +174,7 @@ void f() {
|
|||
'Only explicit getters can be converted to methods.');
|
||||
}
|
||||
|
||||
Future _assertInitialConditions_fatal(String message) async {
|
||||
Future<void> _assertInitialConditions_fatal(String message) async {
|
||||
var status = await refactoring.checkInitialConditions();
|
||||
assertRefactoringStatus(status, RefactoringProblemSeverity.FATAL,
|
||||
expectedMessage: message);
|
||||
|
@ -182,7 +182,7 @@ void f() {
|
|||
|
||||
/// Checks that all conditions are OK and the result of applying [refactoring]
|
||||
/// change to [testUnit] is [expectedCode].
|
||||
Future _assertSuccessfulRefactoring(String expectedCode) async {
|
||||
Future<void> _assertSuccessfulRefactoring(String expectedCode) async {
|
||||
await assertRefactoringConditionsOK();
|
||||
var refactoringChange = await refactoring.createChange();
|
||||
this.refactoringChange = refactoringChange;
|
||||
|
|
|
@ -204,7 +204,7 @@ void test() {}
|
|||
'Cannot convert function returning void.');
|
||||
}
|
||||
|
||||
Future _assertInitialConditions_fatal(String message) async {
|
||||
Future<void> _assertInitialConditions_fatal(String message) async {
|
||||
var status = await refactoring.checkInitialConditions();
|
||||
assertRefactoringStatus(status, RefactoringProblemSeverity.FATAL,
|
||||
expectedMessage: message);
|
||||
|
@ -212,7 +212,7 @@ void test() {}
|
|||
|
||||
/// Checks that all conditions are OK and the result of applying the [Change]
|
||||
/// to [testUnit] is [expectedCode].
|
||||
Future _assertSuccessfulRefactoring(String expectedCode) async {
|
||||
Future<void> _assertSuccessfulRefactoring(String expectedCode) async {
|
||||
await assertRefactoringConditionsOK();
|
||||
var refactoringChange = await refactoring.createChange();
|
||||
this.refactoringChange = refactoringChange;
|
||||
|
|
|
@ -1454,7 +1454,7 @@ void f() {
|
|||
_assertSingleLinkedEditGroup(length: 3, offsets: [43, 69], names: ['xy']);
|
||||
}
|
||||
|
||||
Future _assertInitialConditions_fatal_selection() async {
|
||||
Future<void> _assertInitialConditions_fatal_selection() async {
|
||||
var status = await refactoring.checkInitialConditions();
|
||||
assertRefactoringStatus(status, RefactoringProblemSeverity.FATAL,
|
||||
expectedMessage:
|
||||
|
@ -1485,7 +1485,7 @@ void f() {
|
|||
|
||||
/// Checks that all conditions are OK and the result of applying the
|
||||
/// [SourceChange] to [testUnit] is [expectedCode].
|
||||
Future _assertSuccessfulRefactoring(String expectedCode) async {
|
||||
Future<void> _assertSuccessfulRefactoring(String expectedCode) async {
|
||||
await assertRefactoringConditionsOK();
|
||||
var refactoringChange = await refactoring.createChange();
|
||||
this.refactoringChange = refactoringChange;
|
||||
|
|
|
@ -3299,25 +3299,25 @@ class _ExtractMethodTest extends RefactoringTest {
|
|||
@override
|
||||
late ExtractMethodRefactoringImpl refactoring;
|
||||
|
||||
Future _assertConditionsError(String message) async {
|
||||
Future<void> _assertConditionsError(String message) async {
|
||||
var status = await refactoring.checkAllConditions();
|
||||
assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
|
||||
expectedMessage: message);
|
||||
}
|
||||
|
||||
Future _assertConditionsFatal(String message) async {
|
||||
Future<void> _assertConditionsFatal(String message) async {
|
||||
var status = await refactoring.checkAllConditions();
|
||||
assertRefactoringStatus(status, RefactoringProblemSeverity.FATAL,
|
||||
expectedMessage: message);
|
||||
}
|
||||
|
||||
Future _assertFinalConditionsError(String message) async {
|
||||
Future<void> _assertFinalConditionsError(String message) async {
|
||||
var status = await refactoring.checkFinalConditions();
|
||||
assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
|
||||
expectedMessage: message);
|
||||
}
|
||||
|
||||
Future _assertRefactoringChange(String expectedCode) async {
|
||||
Future<void> _assertRefactoringChange(String expectedCode) async {
|
||||
var refactoringChange = await refactoring.createChange();
|
||||
this.refactoringChange = refactoringChange;
|
||||
assertTestChangeResult(expectedCode);
|
||||
|
@ -3325,7 +3325,7 @@ class _ExtractMethodTest extends RefactoringTest {
|
|||
|
||||
/// Checks that all conditions are OK and the result of applying the [Change]
|
||||
/// to [testUnit] is [expectedCode].
|
||||
Future _assertSuccessfulRefactoring(String expectedCode) async {
|
||||
Future<void> _assertSuccessfulRefactoring(String expectedCode) async {
|
||||
await assertRefactoringConditionsOK();
|
||||
refactoring.createGetter = false;
|
||||
return _assertRefactoringChange(expectedCode);
|
||||
|
|
|
@ -1884,24 +1884,24 @@ class _InlineMethodTest extends RefactoringTest {
|
|||
bool? deleteSource;
|
||||
bool? inlineAll;
|
||||
|
||||
Future _assertConditionsError(String message) async {
|
||||
Future<void> _assertConditionsError(String message) async {
|
||||
var status = await refactoring.checkAllConditions();
|
||||
assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
|
||||
expectedMessage: message);
|
||||
}
|
||||
|
||||
Future _assertConditionsFatal(String message) async {
|
||||
Future<void> _assertConditionsFatal(String message) async {
|
||||
var status = await refactoring.checkAllConditions();
|
||||
assertRefactoringStatus(status, RefactoringProblemSeverity.FATAL,
|
||||
expectedMessage: message);
|
||||
}
|
||||
|
||||
Future _assertInvalidSelection() {
|
||||
Future<void> _assertInvalidSelection() {
|
||||
return _assertConditionsFatal(
|
||||
'Method declaration or reference must be selected to activate this refactoring.');
|
||||
}
|
||||
|
||||
Future _assertSuccessfulRefactoring(String expectedCode) async {
|
||||
Future<void> _assertSuccessfulRefactoring(String expectedCode) async {
|
||||
var status = await refactoring.checkInitialConditions();
|
||||
assertRefactoringStatusOK(status);
|
||||
// configure
|
||||
|
|
|
@ -527,7 +527,8 @@ part 'test2.dart';
|
|||
assertNoFileChange(testFile);
|
||||
}
|
||||
|
||||
Future _assertFailedRefactoring(RefactoringProblemSeverity expectedSeverity,
|
||||
Future<void> _assertFailedRefactoring(
|
||||
RefactoringProblemSeverity expectedSeverity,
|
||||
{String? expectedMessage}) async {
|
||||
var status = await refactoring.checkAllConditions();
|
||||
assertRefactoringStatus(status, expectedSeverity,
|
||||
|
@ -535,7 +536,7 @@ part 'test2.dart';
|
|||
}
|
||||
|
||||
/// Checks that all conditions are OK.
|
||||
Future _assertSuccessfulRefactoring() async {
|
||||
Future<void> _assertSuccessfulRefactoring() async {
|
||||
await assertRefactoringConditionsOK();
|
||||
refactoringChange = await refactoring.createChange();
|
||||
}
|
||||
|
|
|
@ -581,7 +581,7 @@ class B extends A {}
|
|||
return aaaRootPath;
|
||||
}
|
||||
|
||||
Future _ensureContainedFilesKnown() async {
|
||||
Future<void> _ensureContainedFilesKnown() async {
|
||||
for (var driver in allDrivers) {
|
||||
var contextRoot = driver.analysisContext!.contextRoot;
|
||||
for (var file in contextRoot.analyzedFiles()) {
|
||||
|
|
|
@ -49,7 +49,7 @@ class SocketServerTest {
|
|||
});
|
||||
}
|
||||
|
||||
static Future createAnalysisServer_successful() {
|
||||
static Future<void> createAnalysisServer_successful() {
|
||||
var channel = MockServerChannel();
|
||||
_createSocketServer(channel);
|
||||
channel.expectMsgCount(notificationCount: 1);
|
||||
|
|
|
@ -788,7 +788,7 @@ import 'a.dart';
|
|||
}
|
||||
}
|
||||
|
||||
Future _compute(String content) async {
|
||||
Future<void> _compute(String content) async {
|
||||
var context = _updateFile(content);
|
||||
|
||||
_completionResult = await _newComputer().compute(
|
||||
|
|
|
@ -987,7 +987,7 @@ int bar = 2; // 2
|
|||
}
|
||||
}
|
||||
|
||||
class _NodesCollector extends UnifyingAstVisitor {
|
||||
class _NodesCollector extends UnifyingAstVisitor<void> {
|
||||
final bool Function(AstNode) filter;
|
||||
final List<AstNode> _nodes = [];
|
||||
|
||||
|
|
|
@ -238,13 +238,13 @@ class SelectionData {
|
|||
SelectionData();
|
||||
}
|
||||
|
||||
class VisitMethodVisitor extends RecursiveAstVisitor {
|
||||
class VisitMethodVisitor extends RecursiveAstVisitor<void> {
|
||||
List<ExecutableElement> visitedLists = [];
|
||||
|
||||
VisitMethodVisitor();
|
||||
|
||||
@override
|
||||
visitMethodInvocation(MethodInvocation node) {
|
||||
void visitMethodInvocation(MethodInvocation node) {
|
||||
if (node.methodName.name == '_fromList') {
|
||||
var argument = node.argumentList.arguments.first;
|
||||
if (argument is PrefixedIdentifier) {
|
||||
|
|
|
@ -165,7 +165,7 @@ class Server {
|
|||
/// are received after this function call, so it is safe to use this getter
|
||||
/// multiple times in one test; each time it is used it will wait afresh for
|
||||
/// analysis to finish.
|
||||
Future get analysisFinished {
|
||||
Future<void> get analysisFinished {
|
||||
var completer = _analysisFinishedCompleter ??= Completer<void>();
|
||||
return completer.future;
|
||||
}
|
||||
|
@ -201,7 +201,7 @@ class Server {
|
|||
/// [filePaths] to the list of errors in the file at that path.
|
||||
Future<ErrorMap> computeErrorMap(List<String> filePaths) async {
|
||||
var errorMap = ErrorMap();
|
||||
var futures = <Future>[];
|
||||
var futures = <Future<void>>[];
|
||||
for (var filePath in filePaths) {
|
||||
var requestData = sendAnalysisGetErrors(filePath);
|
||||
futures.add(requestData.respondedTo.then((Response response) {
|
||||
|
|
|
@ -39,13 +39,13 @@ class SimpleTest extends TimingTest {
|
|||
|
||||
/// A completer that will be completed when code completion results have been
|
||||
/// received from the server.
|
||||
late Completer completionReceived;
|
||||
late Completer<void> completionReceived;
|
||||
|
||||
/// Initialize a newly created test.
|
||||
SimpleTest();
|
||||
|
||||
@override
|
||||
Future oneTimeSetUp() {
|
||||
Future<void> oneTimeSetUp() {
|
||||
return super.oneTimeSetUp().then((_) {
|
||||
mainFilePath = sourcePath('test.dart');
|
||||
originalContent = r'''
|
||||
|
@ -65,7 +65,7 @@ f(C c) {
|
|||
}
|
||||
|
||||
@override
|
||||
Future perform() {
|
||||
Future<void> perform() {
|
||||
sendAnalysisUpdateContent({
|
||||
mainFilePath: ChangeContentOverlay([SourceEdit(cursorOffset, 0, '.')])
|
||||
});
|
||||
|
@ -74,7 +74,7 @@ f(C c) {
|
|||
}
|
||||
|
||||
@override
|
||||
Future setUp() {
|
||||
Future<void> setUp() {
|
||||
completionReceived = Completer();
|
||||
onCompletionResults.listen((_) {
|
||||
// We only care about the time to the first response.
|
||||
|
@ -89,7 +89,7 @@ f(C c) {
|
|||
}
|
||||
|
||||
@override
|
||||
Future tearDown() {
|
||||
Future<void> tearDown() {
|
||||
sendAnalysisSetAnalysisRoots([], []);
|
||||
return Future.value();
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@ abstract class TimingTest extends IntegrationTest {
|
|||
|
||||
/// Perform any operations that part of a single iteration. It is the
|
||||
/// execution of this method that will be measured.
|
||||
Future perform();
|
||||
Future<void> perform();
|
||||
|
||||
/// Return a future that will complete with a timing result representing the
|
||||
/// number of milliseconds required to perform the operation the specified
|
||||
|
@ -178,7 +178,7 @@ abstract class TimingTest extends IntegrationTest {
|
|||
}
|
||||
|
||||
/// Perform any operations that need to be performed before each iteration.
|
||||
Future setUp();
|
||||
Future<void> setUp();
|
||||
|
||||
/// Convert the given [relativePath] to an absolute path, by interpreting it
|
||||
/// relative to [sourceDirectory]. On Windows any forward slashes in
|
||||
|
@ -188,7 +188,7 @@ abstract class TimingTest extends IntegrationTest {
|
|||
}
|
||||
|
||||
/// Perform any operations that need to be performed after each iteration.
|
||||
Future tearDown();
|
||||
Future<void> tearDown();
|
||||
|
||||
/// Write a source file with the given absolute [pathname] and [contents].
|
||||
///
|
||||
|
|
Loading…
Reference in a new issue