我如何设置默认启动。 vs代码中的申请

发布于 2025-01-21 14:56:38 字数 220 浏览 0 评论 0原文

我已经设置了我的启动。Jason和Tasks.json文件的VS代码文件,可以使用该文件调试我的应用程序。问题是,每当我创建一个新应用程序时,我都必须从一个旧应用程序中找到文件,然后将其复制到新的应用程序文件夹中。而且,如果我删除这些.json文件,我别无选择,只能再次重写它们,这非常不便。

有没有办法将这些文件设置为所有C/C ++项目的默认文件?因此,每当我创建一个新项目时,VS代码都会自动加载这些文件?

I have set up my launch.jason and tasks.json files for VS Code, and can debug my applications using that. The problem is whenever I create a new application, I have to find the files from one of my old apps and copy paste them to the new application folder. And if I delete these .json files, I have no option but to rewrite them again which is pretty inconvenient.

Is there a way to set these files as the default ones for all C/C++ projects? So whenever I create a new project, VS Code automatically loads these files?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

べ繥欢鉨o。 2025-01-28 14:56:38

虽然我自己从未做过这件事,但 vs代码文档建议您可以拥有在项目之外范围范围内范围范围的启动设置:

vs代码在启动中保留调试配置信息。 /debugging#_global-launch-configuration" rel="nofollow noreferrer">user settings or

docs 似乎也暗示VS代码可能具有通过更广泛的范围范围的任务, a“ task task Provister ”:

工作区或文件夹特定任务是从tasks.json文件中配置的.vscode workspace的文件夹。

扩展也可以使用a 任务提供者和这些贡献的任务可以添加tasks.json文件中定义的工作区特定配置。

我意识到实际使用这些功能的人的答案是可取的,但我认为我仍然指出它们。

While I have never done this myself, the VS Code docs seem to suggest that you can have launch setting which are scoped outside of your project:

VS Code keeps debugging configuration information in a launch.json file located in a .vscode folder in your workspace (project root folder) or in your user settings or workspace settings.

The docs also seem to suggest that VS Code might have a mechanism for wider scoped tasks through a "Task Provider":

Workspace or folder specific tasks are configured from the tasks.json file in the .vscode folder for a workspace.

Extensions can also contribute tasks using a Task Provider, and these contributed tasks can add workspace-specific configurations defined in the tasks.json file.

I realise an answer from someone who has actually used these features would be preferable, but I thought I'd point them out nonetheless.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文