gpt4 book ai didi

visual-studio-code - 如何在launch.json中配置vs代码工作目录

转载 作者:行者123 更新时间:2023-12-04 19:28:59 24 4
gpt4 key购买 nike

我使用goland(与webstorm/intellij等相同)IDE,并且在调试配置中有一个可以配置working directory的地方。现在,我尝试使用VSCODE,但没有找到此配置,经过一番研究后,我发现以下json应该处理此问题,但找不到正确的工作目录位置

例如这是我的工作目录
/Users/i022226/go/src/myapp

"configurations": [{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceRoot}"
},
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceRoot}"
},
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "debug",
"remotePath": "",
"port": 2345,
"host": "127.0.0.1",
"program": "${fileDirname}",
"env": {},
"args": [],
"showLog": true
}

launch.json中,有一个添加配置按钮,当我键入 cwd时,我没有任何输入,有什么想法吗?

在这篇文章中 cwdoption下,但我找不到 option https://github.com/Microsoft/vscode/issues/856

最佳答案

您应该像下面这样添加它

    {
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "debug",
"cwd": "Your Path",
"remotePath": "",
"port": 2345,
"host": "127.0.0.1",
"program": "${fileDirname}",
"env": {},
"args": [],
"showLog": true
}

关于visual-studio-code - 如何在launch.json中配置vs代码工作目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47540627/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com