mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Don't be case-sensitive when checking for extension (#18515)
Seems like VS Code may have started using lowercase extension folders recently (our identifier is `Dart-Code.flutter` but now the folder is named `dart-code.flutter`), so this makes the check not sensitive to casing. Also reuse extension identifier for download link
This commit is contained in:
parent
3f79f8cba5
commit
592c5ba91a
@ -30,12 +30,13 @@ class VsCode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for presence of extension.
|
// Check for presence of extension.
|
||||||
|
final String extensionIdentifierLower = extensionIdentifier.toLowerCase();
|
||||||
final Iterable<FileSystemEntity> extensionDirs = fs
|
final Iterable<FileSystemEntity> extensionDirs = fs
|
||||||
.directory(extensionDirectory)
|
.directory(extensionDirectory)
|
||||||
.listSync()
|
.listSync()
|
||||||
.where((FileSystemEntity d) => d is Directory)
|
.where((FileSystemEntity d) => d is Directory)
|
||||||
.where(
|
.where(
|
||||||
(FileSystemEntity d) => d.basename.startsWith(extensionIdentifier));
|
(FileSystemEntity d) => d.basename.toLowerCase().startsWith(extensionIdentifierLower));
|
||||||
|
|
||||||
if (extensionDirs.isNotEmpty) {
|
if (extensionDirs.isNotEmpty) {
|
||||||
final FileSystemEntity extensionDir = extensionDirs.first;
|
final FileSystemEntity extensionDir = extensionDirs.first;
|
||||||
|
@ -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.flutter';
|
'https://marketplace.visualstudio.com/items?itemName=${VsCode.extensionIdentifier}';
|
||||||
final VsCode _vsCode;
|
final VsCode _vsCode;
|
||||||
|
|
||||||
VsCodeValidator(this._vsCode) : super(_vsCode.productName);
|
VsCodeValidator(this._vsCode) : super(_vsCode.productName);
|
||||||
|
Loading…
Reference in New Issue
Block a user