This commit is contained in:
Martin Aeschlimann 2021-09-21 17:33:35 +02:00
Родитель f0669dde71
Коммит 806b7a386d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 2609A01E695523E3
4 изменённых файлов: 668 добавлений и 2470 удалений

Просмотреть файл

@ -88,23 +88,22 @@
"patch-dev": "yarn compile && node ./build/patch-local.js .vscode-oss-dev"
},
"dependencies": {
"ssri": "6.0.2",
"vscode-extension-telemetry": "0.1.7",
"vscode-extension-telemetry": "0.3.2",
"vscode-nls": "^5.0.0",
"vscode-tas-client": "^0.1.22"
},
"devDependencies": {
"@types/copy-webpack-plugin": "^6.4.0",
"@types/node": "^14.0.27",
"@types/copy-webpack-plugin": "^8.0.1",
"@types/node": "14.x",
"@types/vscode": "^1.52.0",
"@typescript-eslint/eslint-plugin": "^4.28.0",
"@typescript-eslint/parser": "^4.28.0",
"copy-webpack-plugin": "^6.0.3",
"eslint": "^7.29.0",
"ts-loader": "^6.2.1",
"typescript": "^4.3.4",
"@typescript-eslint/eslint-plugin": "^4.31.2",
"@typescript-eslint/parser": "^4.31.2",
"copy-webpack-plugin": "^9.0.1",
"eslint": "^7.32.0",
"ts-loader": "^9.2.6",
"typescript": "4.4.3",
"vscode-nls-dev": "^3.3.2",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12"
"webpack": "^5.53.0",
"webpack-cli": "^4.8.0"
}
}

Просмотреть файл

@ -71,7 +71,7 @@ export async function activate(context: vscode.ExtensionContext) {
return vscode.commands.registerCommand(CommandId.openWSLFolder, async () => {
telemetry.reportCommand(Command.openWSLFolder);
const isWSLInstalled = await checkIfWSLInstalled();
if (!isWSLInstalled) {
if (isWSLInstalled !== true) {
telemetry.reportDialog(Dialog.wslNotInstalled, 'show');
const installWSL = 'Install Now';
const learnMore = 'Learn More';
@ -112,11 +112,38 @@ export async function activate(context: vscode.ExtensionContext) {
// this method is called when your extension is deactivated
export function deactivate() { }
async function checkIfWSLInstalled(): Promise<boolean> {
const dllPath = getLxssManagerDllPath();
return !!(dllPath && await fileExists(dllPath));
export async function checkIfWSLInstalled(): Promise<true | string> {
if (getWindowsBuildNumber() >= 22000) {
const wslExePath = getWSLExecutablePath();
if (wslExePath) {
if (!await fileExists(wslExePath)) {
return `'${wslExePath}' not found`;
}
return new Promise<true | string>(s => {
cp.execFile(wslExePath, ['--status'], (err) => {
if (err) {
s('--status exits with error');
} else {
s(true);
}
});
});
} else {
return `Environment variable 'SystemRoot' not defined`;
}
} else {
const dllPath = getLxssManagerDllPath();
if (dllPath) {
if (await fileExists(dllPath)) {
return true;
} else {
return `'${dllPath}' not found`;
}
} else {
return `Environment variable 'SystemRoot' not defined`;
}
}
}
function hasWSLInstall() {
return getWindowsBuildNumber() >= 20262;
}

Просмотреть файл

@ -1,10 +1,10 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"target": "es2020",
"outDir": "out",
"lib": [
"es6"
"es2020"
],
"sourceMap": true,
"rootDir": "src",

3074
yarn.lock

Разница между файлами не показана из-за своего большого размера Загрузить разницу