[英]How to resolve an error which i am getting when installing vscode for testing my extension?
I made a vscode extension from the github template now to test i have to run this command according to the guide我现在从 github 模板中做了一个 vscode 扩展来测试我必须根据指南运行这个命令
node ./node_modules/vscode/bin/test
Which install vscode to test my ext.哪个安装 vscode 来测试我的分机。 But after it installs i get the output as
但安装后我得到 output
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
In this i am not sure what shall i do?在这我不确定我该怎么办? My ext code is
我的分机代码是
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);
}
EDIT:编辑:
I somehow managed installing the vscode to the ./vscode-test
folder.我以某种方式设法将 vscode 安装到
./vscode-test
文件夹。 Now i wrote a test file some sort like this现在我写了一个类似这样的测试文件
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();
This flile is named as test/index.js
now when i run this file everything is fine and vscode opens for testing and at the same speed it gets closed and displaying the console as failed:这个文件现在被命名为
test/index.js
,当我运行这个文件时,一切都很好,vscode 打开以进行测试,并且以同样的速度关闭并将控制台显示为失败:
Exit code: 1
Done
Failed
Use the current VSC by using an additional Launch config and write the index.(ts/js)
file and your test files .通过使用额外的启动配置来使用当前 VSC,并编写
index.(ts/js)
文件和您的测试文件。
Select this config from the Run/Debug bar and press F5. Select 从运行/调试栏中配置此配置,然后按 F5。
Now there is no need to download VSC.现在无需下载 VSC。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.