Unverified Commit 42c9719f authored by Danny Tuppeny's avatar Danny Tuppeny Committed by GitHub

Change doctor to point at Flutter extension (#17987)

parent 24e2b238
...@@ -13,7 +13,7 @@ import '../base/version.dart'; ...@@ -13,7 +13,7 @@ import '../base/version.dart';
const bool _includeInsiders = false; const bool _includeInsiders = false;
class VsCode { class VsCode {
static const String extensionIdentifier = 'Dart-Code.dart-code'; static const String extensionIdentifier = 'Dart-Code.flutter';
VsCode._(this.directory, this.extensionDirectory, { Version version, this.edition }) VsCode._(this.directory, this.extensionDirectory, { Version version, this.edition })
: this.version = version ?? Version.unknown { : this.version = version ?? Version.unknown {
...@@ -43,7 +43,7 @@ class VsCode { ...@@ -43,7 +43,7 @@ class VsCode {
_isValid = true; _isValid = true;
_extensionVersion = new Version.parse( _extensionVersion = new Version.parse(
extensionDir.basename.substring('$extensionIdentifier-'.length)); extensionDir.basename.substring('$extensionIdentifier-'.length));
_validationMessages.add('Dart Code extension version $_extensionVersion'); _validationMessages.add('Flutter extension version $_extensionVersion');
} }
} }
...@@ -175,7 +175,7 @@ class VsCode { ...@@ -175,7 +175,7 @@ class VsCode {
@override @override
String toString() => String toString() =>
'VS Code ($version)${_extensionVersion != Version.unknown ? ', Dart Code ($_extensionVersion)' : ''}'; 'VS Code ($version)${_extensionVersion != Version.unknown ? ', Flutter ($_extensionVersion)' : ''}';
static String _getVersionFromPackageJson(String packageJsonPath) { static String _getVersionFromPackageJson(String packageJsonPath) {
if (!fs.isFileSync(packageJsonPath)) if (!fs.isFileSync(packageJsonPath))
......
...@@ -10,7 +10,7 @@ import 'vscode.dart'; ...@@ -10,7 +10,7 @@ import 'vscode.dart';
class VsCodeValidator extends DoctorValidator { class VsCodeValidator extends DoctorValidator {
static const String extensionMarketplaceUrl = static const String extensionMarketplaceUrl =
'https://marketplace.visualstudio.com/items?itemName=Dart-Code.dart-code'; 'https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter';
final VsCode _vsCode; final VsCode _vsCode;
VsCodeValidator(this._vsCode) : super(_vsCode.productName); VsCodeValidator(this._vsCode) : super(_vsCode.productName);
...@@ -38,7 +38,7 @@ class VsCodeValidator extends DoctorValidator { ...@@ -38,7 +38,7 @@ class VsCodeValidator extends DoctorValidator {
messages.addAll(_vsCode.validationMessages messages.addAll(_vsCode.validationMessages
.map((String m) => new ValidationMessage.error(m))); .map((String m) => new ValidationMessage.error(m)));
messages.add(new ValidationMessage( messages.add(new ValidationMessage(
'Dart Code extension not installed; install from\n$extensionMarketplaceUrl')); 'Flutter extension not installed; install from\n$extensionMarketplaceUrl'));
} }
return new ValidationResult(type, messages, statusInfo: vsCodeVersionText); return new ValidationResult(type, messages, statusInfo: vsCodeVersionText);
......
...@@ -46,8 +46,8 @@ void main() { ...@@ -46,8 +46,8 @@ void main() {
expect(message.message, 'VS Code at ${VsCodeValidatorTestTargets.validInstall}'); expect(message.message, 'VS Code at ${VsCodeValidatorTestTargets.validInstall}');
message = result.messages message = result.messages
.firstWhere((ValidationMessage m) => m.message.startsWith('Dart Code ')); .firstWhere((ValidationMessage m) => m.message.startsWith('Flutter '));
expect(message.message, 'Dart Code extension version 4.5.6'); expect(message.message, 'Flutter extension version 4.5.6');
}); });
testUsingContext('vs code validator when 64bit installed', () async { testUsingContext('vs code validator when 64bit installed', () async {
...@@ -62,8 +62,8 @@ void main() { ...@@ -62,8 +62,8 @@ void main() {
expect(message.message, 'VS Code at ${VsCodeValidatorTestTargets.validInstall}'); expect(message.message, 'VS Code at ${VsCodeValidatorTestTargets.validInstall}');
message = result.messages message = result.messages
.firstWhere((ValidationMessage m) => m.message.startsWith('Dart Code ')); .firstWhere((ValidationMessage m) => m.message.startsWith('Flutter '));
expect(message.message, 'Dart Code extension version 4.5.6'); expect(message.message, 'Flutter extension version 4.5.6');
}); });
testUsingContext('vs code validator when extension missing', () async { testUsingContext('vs code validator when extension missing', () async {
...@@ -77,8 +77,8 @@ void main() { ...@@ -77,8 +77,8 @@ void main() {
expect(message.message, 'VS Code at ${VsCodeValidatorTestTargets.validInstall}'); expect(message.message, 'VS Code at ${VsCodeValidatorTestTargets.validInstall}');
message = result.messages message = result.messages
.firstWhere((ValidationMessage m) => m.message.startsWith('Dart Code ')); .firstWhere((ValidationMessage m) => m.message.startsWith('Flutter '));
expect(message.message, startsWith('Dart Code extension not installed')); expect(message.message, startsWith('Flutter extension not installed'));
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment