microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.95k stars 29.18k forks source link

Dev container: Install configured extensions in all profiles #176678

Closed jvillemure closed 1 year ago

jvillemure commented 1 year ago

Type: Bug

Regression since 1.76. Today I created a new devcontainer. I normally want several extensions to be automatically installed in any container I create, so I list those in "dev.containers.defaultExtensions" in my user settings.json:

"dev.containers.defaultExtensions": [
    // ...
    "ms-vscode.cmake-tools",
    "ms-vscode.cpptools",
    "ms-vscode.hexeditor",
    "ms-vscode.makefile-tools",
    // ...
],

Expected behavior: Formerly, all extensions listed there would be installed in the new container; I didn't need to list those in my any devcontainer.json neither. Actual behavior: My new devcontainer has 0 extensions installed in it.

I got further and also tried to explicitly listed those extensions in my new container's devcontainer.json:

"customizations": {
    "vscode": {
        "settings": {},
        "extensions": [
            // ...
            "ms-vscode.cmake-tools",
            "ms-vscode.cpptools",
            "ms-vscode.hexeditor",
            "ms-vscode.makefile-tools",
            // ...
        ]
    }
},

Expected behavior: extensions listed in devcontainer.json are install after the container is created. Actual behavior: My new devcontainer has 0 extensions installed in it.

Steps to reproduce:

VS Code version: Code 1.76.0 (92da9481c0904c6adfe372c12da3b7748d74bdcb, 2023-03-01T10:22:44.506Z) OS version: Windows_NT x64 10.0.19045 Modes: Sandboxed: No Remote OS version: Linux x64 5.15.90.1-microsoft-standard-WSL2

System Info |Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz (16 x 2496)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|undefined| |Memory (System)|15.73GB (1.09GB free)| |Process Argv|--crash-reporter-id c5a1a827-bcc3-4406-8db9-b4ae3a1d12c9| |Screen Reader|no| |VM|0%| |Item|Value| |---|---| |Remote|Dev Container: milo-development-environment| |OS|Linux x64 5.15.90.1-microsoft-standard-WSL2| |CPUs|11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz (16 x 2496)| |Memory (System)|7.62GB (5.35GB free)| |VM|0%|
Extensions (21) Extension|Author (truncated)|Version ---|---|--- language-x86-64-assembly|13x|3.0.0 Bookmarks|ale|13.3.1 language-gas-x86|bas|0.0.2 file-icons|fil|1.0.29 codespaces|Git|1.13.10 remotehub|Git|0.53.2023030801 vscode-drawio|hed|1.6.6 better-shellscript-syntax|jef|1.4.5 vscode-boost-jam|mlo|0.0.2 jupyter-keymap|ms-|1.1.0 remote-containers|ms-|0.283.0 remote-ssh|ms-|0.99.2023030315 remote-ssh-edit|ms-|0.84.0 remote-wsl|ms-|0.76.1 vscode-remote-extensionpack|ms-|0.24.0 azure-repos|ms-|0.29.2023030801 remote-explorer|ms-|0.3.2023021509 remote-repositories|ms-|0.31.2023030901 remote-server|ms-|1.1.2023022709 conanlight|Son|1.4.0 vscode-icons|vsc|12.2.0 (1 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 pythonvspyl392:30443607 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 pythondataviewer:30285071 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593cf:30376535 pythonvs932:30410667 cppdebug:30492333 vsclangdf:30486550 c4g48928:30535728 dsvsc012:30540252 pynewext54:30681850 azure-dev_surveyonecf:30548226 pyindex848:30662994 nodejswelcome1:30587005 3biah626:30602489 pyind779:30671433 89544117:30613380 pythonsymbol12:30671437 2i9eh265:30646982 showlangstatbar:30672706 vsccsb:30677849 funwalk2cf:30676044 ```
vscodenpa commented 1 year ago

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.76.1. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

sandy081 commented 1 year ago

@chrmarti This is happening because dev containers extension is installing extensions in the default profile and the user is using non default profile. Is it possible to create extensions in the profile user is using while the dev container is created?

sandy081 commented 1 year ago

@chrmarti I have added --all-profiles arg to the server cli. This will allow installing extensions to all profiles. These extensions will be loaded irrespective of any user profile. Can you please adopt to this arg in dev containers extension?

sandy081 commented 1 year ago

I made another fix here that retains previous behaviour. I made extensions installed during server startup are available for all profiles. It does not need adoption from remote extensions.

sandy081 commented 1 year ago

To verify: