flutter/packages/flutter_tools/lib/src/vscode/vscode_validator.dart
Ian Hickson 76f70810e4
[O] Remove many timeouts. (#23531)
* Remove many timeouts.

These are essentially self-inflicted race conditions. Instead of timeouts we're going to try a more verbose logging mechanism that points out when things are taking a long time.

* Get the attach tests to pass.

* Apply review comments from Todd

* More review comment fixes

* Put back the extended timeouts here now that I know why we have them...
2018-12-20 17:10:40 -08:00

40 lines
1.1 KiB
Dart

// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import '../base/user_messages.dart';
import '../base/version.dart';
import '../doctor.dart';
import 'vscode.dart';
class VsCodeValidator extends DoctorValidator {
VsCodeValidator(this._vsCode) : super(_vsCode.productName);
final VsCode _vsCode;
static Iterable<DoctorValidator> get installedValidators {
return VsCode
.allInstalled()
.map<DoctorValidator>((VsCode vsCode) => VsCodeValidator(vsCode));
}
@override
Future<ValidationResult> validate() async {
final String vsCodeVersionText = _vsCode.version == Version.unknown
? null
: userMessages.vsCodeVersion(_vsCode.version.toString());
final ValidationType validationType = _vsCode.isValid
? ValidationType.installed
: ValidationType.partial;
return ValidationResult(
validationType,
_vsCode.validationMessages,
statusInfo: vsCodeVersionText,
);
}
}