[英]Why No Matching Commands when I init my first vscode extension?
I init my first vscode extension following this page .我在这个页面之后初始化了我的第一个 vscode 扩展。
Here is my steps:这是我的步骤:
And here is the package.json generated:这是生成的 package.json:
{
"name": "helloworld",
"displayName": "helloworld",
"description": "description helloworld",
"version": "0.0.1",
"engines": {
"vscode": "^1.72.0"
},
"categories": [
"Other"
],
"activationEvents": [
"onCommand:helloworld.helloWorld"
],
"main": "./out/extension.js",
"contributes": {
"commands": [
{
"command": "helloworld.helloWorld",
"title": "Hello World"
}
]
},
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"pretest": "npm run compile && npm run lint",
"lint": "eslint src --ext ts",
"test": "node ./out/test/runTest.js"
},
"devDependencies": {
"@types/glob": "^8.0.0",
"@types/mocha": "^10.0.0",
"@types/node": "16.x",
"@types/vscode": "^1.72.0",
"@typescript-eslint/eslint-plugin": "^5.38.1",
"@typescript-eslint/parser": "^5.38.1",
"@vscode/test-electron": "^2.1.5",
"eslint": "^8.24.0",
"glob": "^8.0.3",
"mocha": "^10.0.0",
"typescript": "^4.8.4"
}
}
When I press H5 to debug, I got no command matched here:当我按 H5 进行调试时,我没有找到匹配的命令:
I was stuck here for a while, where is my command??我被困在这里一段时间了,我的命令在哪里??
I've encountered this just now as well.我刚才也遇到了这个。 Make sure that
engines.vscode
in package.json
matches the version of vscode you are running:确保 package.json 中的
engines.vscode
与您正在运行的package.json
版本匹配:
"engines": {
"vscode": "^1.73.0"
},
I guess the generator will use the latest version available, but you might not have upgraded yet.我猜生成器将使用可用的最新版本,但您可能尚未升级。 That was the case for me.
我就是这种情况。
@tacospice pointed out exactly. @tacospice 准确指出。 in
package.json
, engines.vscode
determines minimum version of VSCode.在
package.json
中, engines.vscode
确定 VSCode 的最低版本。 In my case, yo
created extension template which set minimum VSCode version(1.74.0) newer than working VSCode(1.70.0).在我的例子中,
yo
创建了扩展模板,它设置了比工作 VSCode (1.70.0) 更新的最低 VSCode 版本 (1.74.0)。 Check Help -> About -> version
with package.json
.使用
package.json
检查Help -> About -> version
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.