visual-studio-codevscode-devcontainer

Installing recommended VS Code extensions in Dev Container


In Visual Studio Code, it is possible to recommend extensions for a project by listing them in the file .vscode/extensions.json.

For Dev Containers, it is possible to automatically install extensions upon creation of the container by listing them in the file devcontainer.json.

I would like for all the recommended extensions to be installed in the Dev Container. Is it possible to install extensions in the Dev Container based on .vscode/extensions.json and not have to maintain the list of extensions in two places?


Solution

  • No, unfortunately there’s nothing in the spec that lets you pull those values from another file, you just have to copy them yourself.

    source: https://containers.dev/implementors/json_schema/#main-schema