我尝试创建VS代码扩展并按照文档here中提供的步骤进行操作
我设置" helloworld"打字稿中的项目但是当我按下" F5"时,什么也没发生。我看到,打字稿文件符合JS,但项目没有打开VS代码的新实例,并且未启用调试模式" F5"。
有什么建议吗?。
launch.json文件
{
"version": "0.2.0",
"configurations": [
{
"name": "Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "npm: watch"
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test"
],
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "npm: watch"
},
]
}
我遵循的步骤与VS代码文档中提到的相同
按F5或单击“调试”图标,然后单击“开始”。
对我来说,步骤#5不起作用,没有做任何事情
答案 0 :(得分:2)
您的启动文件看起来不像yo 2.0.2
生成的文件。
那个生成启动文件版本0.1.0而不是像你的0.2.0。
目前你应该有yo 2.0.2和vscode 1.24.0。请验证。
我从头开始为vscode创建了一个typescript扩展,并得到了这个:
{
"version": "0.1.0",
"configurations": [
{
"name": "Launch Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
"stopOnEntry": false,
"sourceMaps": true,
"outDir": "${workspaceRoot}/out/src",
"preLaunchTask": "npm"
},
{
"name": "Launch Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test" ],
"stopOnEntry": false,
"sourceMaps": true,
"outDir": "${workspaceRoot}/out/test",
"preLaunchTask": "npm"
}
]
}
答案 1 :(得分:0)
对于我来说,我只是重新安装了相同版本的节点,问题已解决。
$ export PYTHON_BIN_PATH=/usr/bin/python
$ echo $PYTHON_BIN_PATH
/usr/bin/python
参考:Error: Cannot find module '../lib/utils/unsupported.js' while using Ionic