typescript - 如何解决我在安装 vscode 以测试我的扩展程序时遇到的错误?
问题描述
我现在从 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
解决方案
推荐阅读
- image-processing - 将 320x240x3 点云矩阵转换为 320x240x1 深度图
- r - 当目标不均匀分布时为训练数据集选择行
- performance - 我看不到 perf 的功率/能量核心选项来测量功耗
- javascript - 当我单击图标时,语义 UI 会在下拉菜单中对下拉菜单做出反应,并关闭搜索
- kubernetes - 如何使 pod 在 EKS 工作节点上的特定路径上运行
- hybris - 用于 Spartacus 设置的辅助服务模块 (ASM)
- docker - docker compose 3.7 中的非根扩展字段
- asp.net-mvc - jQuery UI dateFormat 不改变格式
- java - 安装 NetBeans 时如何修复错误?
- numpy - 检查输入时出错:预期 flatten_1_input 有 3 个维度,但得到了形状为 (28, 28) 的数组