1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

すべてのワークスペースに共通のデバッグ構成を設定する(Visual Studio Code)

Last updated at Posted at 2021-05-21

Visual Studio Codeでのデバッグの構成(project_root/.vscode/launch.json)はプロジェクトごとに作成します。ですが、だいたいいつも同じ内容なのに、毎回作成するのはめんどうですね。
公式ドキュメントに従い、settings.jsonに追加することで、グローバルに共通のデバッグ構成(=デフォルトのlaunch.json)を設定することができます。

設定例

以下のデバッグ構成をすべてのワークスペースから利用できるようにしてみます。

launch.json
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal"
        },
    ]
}

Ctrl+Shift+Pでコマンドパレットを開き、settings.jsonと入力し、Preferences: Open Settings(JSON)を選択し、ユーザーのsettings.jsonを開きます。開いたら、次のようにデバッグ構成を追加します:

settings.json(ユーザー)
{
    ....
    (何かいろいろなもの)
    ....
    "launch":{
        "version": "0.2.0",
        "configurations": [
            {
                "name": "Python: Current File",
                "type": "python",
                "request": "launch",
                "program": "${file}",
                "console": "integratedTerminal"
            }
        ]
    }
}

これでOKです。

参考

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?