How to add extension settings to devcontainer.json?
Asked Answered
S

1

6

In a Codespaces .devcontainer/devcontainer.json file I may have the following:

"customizations": {
  "vscode": {
    "extensions": [
      "snowflake.snowflake-vsc"
    ]
  }
}

and in the Codespaces VS Code environment, I copy a setting I want to persist for all Codespaces environments, e.g.

"git.autofetch": true

I should note here that git appears to be a default extension either with VS code or the miniconda dockerfile base image I'm using. In any case, I think these two quoted concepts are related, or maybe they're not exactly, but I can't seem to find any guidance on how to actually persist the git setting. Any takers?

Supplemental answered 7/9, 2023 at 4:50 Comment(0)
E
3

You cannot directly define extension settings in the devcontainer.json. But if you need these settings to be version controlled and persistent, they can be defined in .vscode/settings.json

{
"git.autofetch": true
}
Ecumenical answered 23/12, 2023 at 20:23 Comment(1)
I can and have defined extension settings in devcontainer.json. It would be in "customizations": { "vscode": { "settings": { "[python]": {...} }}}Topflight

© 2022 - 2024 — McMap. All rights reserved.