如何解决我在安装 vscode 以测试我的扩展程序时遇到的错误?
How to resolve an error which i am getting when installing vscode for testing my extension?
我现在从 github 模板做了一个 vscode 扩展来测试我必须 运行 根据指南
这个命令
node ./node_modules/vscode/bin/test
安装 vscode 来测试我的分机。但是安装后我得到的输出为
Downloading VS Code 1.54.3 into .vscode-test/vscode-1.54.3.
Downloading VS Code from: https://update.code.visualstudio.com/1.54.3/win32-archive/stable
Downloaded VS Code 1.54.3
Test error: Error: spawn E:\NewProj\glitter-ext\.vscode-test\vscode-1.54.3\Code.exe ENOENT
Exit code: -4058
Done
Failed
在这我不知道该怎么办?
我的分机号是
import * as vscode from 'vscode';
export function activate(context: vscode.ExtensionContext) {
console.log('Congratulations, your extension "hello-world-vscode-extension" is now active!');
let disposable = vscode.commands.registerCommand('extension.sayHello', () => {
vscode.window.showInformationMessage('Hello World!');
});
context.subscriptions.push(disposable);
}
编辑:
我以某种方式设法将 vscode 安装到 ./vscode-test
文件夹。现在我写了一个类似这样的测试文件
const { runTests } = require('vscode-test');
const path = require('path');
async function test() {
try{
await runTests({
extensionPath: path.join(__dirname, "../dist/"),
testRunnerPath: path.join(__dirname, "../.vscode-test/"),
extensionDevelopmentPath: path.join(__dirname, "../dist/")
})
}catch(e){
console.error(e);
}
}
test();
这个文件现在被命名为 test/index.js
当我 运行 这个文件一切正常并且 vscode 打开进行测试并且以同样的速度关闭并显示控制台失败:
Exit code: 1
Done
Failed
通过additional Launch config and write the index.(ts/js)
file and your test files使用当前的VSC。
Select 这个配置来自 Run/Debug 栏并按 F5。
现在不需要下载VSC了。
我现在从 github 模板做了一个 vscode 扩展来测试我必须 运行 根据指南
这个命令node ./node_modules/vscode/bin/test
安装 vscode 来测试我的分机。但是安装后我得到的输出为
Downloading VS Code 1.54.3 into .vscode-test/vscode-1.54.3.
Downloading VS Code from: https://update.code.visualstudio.com/1.54.3/win32-archive/stable
Downloaded VS Code 1.54.3
Test error: Error: spawn E:\NewProj\glitter-ext\.vscode-test\vscode-1.54.3\Code.exe ENOENT
Exit code: -4058
Done
Failed
在这我不知道该怎么办? 我的分机号是
import * as vscode from 'vscode';
export function activate(context: vscode.ExtensionContext) {
console.log('Congratulations, your extension "hello-world-vscode-extension" is now active!');
let disposable = vscode.commands.registerCommand('extension.sayHello', () => {
vscode.window.showInformationMessage('Hello World!');
});
context.subscriptions.push(disposable);
}
编辑:
我以某种方式设法将 vscode 安装到 ./vscode-test
文件夹。现在我写了一个类似这样的测试文件
const { runTests } = require('vscode-test');
const path = require('path');
async function test() {
try{
await runTests({
extensionPath: path.join(__dirname, "../dist/"),
testRunnerPath: path.join(__dirname, "../.vscode-test/"),
extensionDevelopmentPath: path.join(__dirname, "../dist/")
})
}catch(e){
console.error(e);
}
}
test();
这个文件现在被命名为 test/index.js
当我 运行 这个文件一切正常并且 vscode 打开进行测试并且以同样的速度关闭并显示控制台失败:
Exit code: 1
Done
Failed
通过additional Launch config and write the index.(ts/js)
file and your test files使用当前的VSC。
Select 这个配置来自 Run/Debug 栏并按 F5。
现在不需要下载VSC了。