可以有一个全局的launch.json文件吗? [英] Is it possible to have a global launch.json file?

查看:232
本文介绍了可以有一个全局的launch.json文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Don Jayamanne的Python 扩展,并且运行良好。我唯一的问题是我正在处理的每个项目,都必须复制 \.vscode\launch.json 文件。我想知道是否有办法将该文件全局放置在某个地方,以便将设置应用于我的所有项目。类似于全局 settings.json 用于用户设置的方式。

I am using Don Jayamanne's Python extension and it is working well. The only issue I have is for every project I work on, I have to copy the \.vscode\launch.json file. I was wondering if there is a way to place that file somewhere globally so the settings are applied to all my projects. Something similar to how the global settings.json works for user settings.

换句话说,我正在寻找一种避免复制的方法 \.vscode\launch.json 到我存储并在其中写入python代码的每个文件夹。

In other words I am looking for a way to avoid having to copy \.vscode\launch.json to every folder I store and write python code in.

推荐答案

是的,有可能-您需要将必需的启动配置直接放在用户设置文件中,如此处

Yes, it is possible - you need to put the requisite launch config directly in your user settings file, as described here.

来自链接页面:


...当前不可能有一个全局的launch.json文件,该文件将在所有地方使用,但是有效的方法是在用户设置(首选项>用户设置)中添加一个启动对象。这样,它将在您所有的工作区中共享

示例:

... currently it is not possible to have one global launch.json file which would be used everywhere, but what works is to add a "launch" object inside your user settings (preferences > user settings). This way it will be shared across all your workspaces
Example:

"launch": {
    "version": "0.2.0",
    "configurations": [
        {
        "type": "node",
        "request": "launch",
        "name": "Launch Program",
        "program": "${file}",
        "cwd": "${workspaceRoot}",
        "runtimeExecutable": "/usr/local/bin/node"
        }
    ]
}


这篇关于可以有一个全局的launch.json文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆