I am creating a new Extension for Vscode. I am following the "your first extension" guide. When I press F5 absolutely nothing happen.
My system is:
Things I already checked:
What can I do to make F5 work ?
i haven't changed anything in the files yet. this are my files:
launch.json
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
],
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
tasks.json
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
package.json
{
"name": "xxxxx",
"displayName": "xxxxx",
"description": "xxxxx",
"version": "0.0.1",
"engines": {
"vscode": "^1.76.0"
},
"categories": [
"Other"
],
"activationEvents": [],
"main": "./out/extension.js",
"contributes": {
"commands": [
{
"command": "xxxxx",
"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/vscode": "^1.76.0",
"@types/glob": "^8.1.0",
"@types/mocha": "^10.0.1",
"@types/node": "16.x",
"@typescript-eslint/eslint-plugin": "^5.53.0",
"@typescript-eslint/parser": "^5.53.0",
"eslint": "^8.34.0",
"glob": "^8.1.0",
"mocha": "^10.2.0",
"typescript": "^4.9.5",
"@vscode/test-electron": "^2.2.3"
}
}
Since your issue may be the same as I cannot build my VSCode extension project in VSCode after update to 1.76 I strongly encourage you to add your information there in case the original OP doesn't respond to request for more information and to help the devs to figure out what is going on.
In the meantime, you may want to downgrade to v1.75.2 and see if it works there. By the way, launching a debug session of an extension still works for me in v1.76, so your particular info would be valuable in the issue.
I am adding my launch config for comparison:
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"${workspaceFolder}/../OneDrive/TestMultiRoot", // this is what the ExtensionHost will open
"--extensionDevelopmentPath=${workspaceFolder}"
]
}
it is quite different than yours, perhaps I am using an older version of the yo
generator? You might try copying this into your launch.json
and commenting out your current version and see if anything happens.