coder / modules

A collection of Terraform Modules to work with Coder.
https://registry.coder.com
Apache License 2.0
23 stars 19 forks source link

feat(code-server): install extensions from `.vscode/extensions.json` #231

Closed michaelbrewer closed 2 months ago

michaelbrewer commented 2 months ago

Add a new flag auto_install_extensions which auto installed the recommended extensions found in .vscode/extensions.json

Example .vscode/extensions.json

{
    "recommendations": [
        "hashicorp.terraform"
    ]
}

Example terraform template snippet

module "code-server" {
 source                   = "registry.coder.com/modules/code-server/coder"
  version                 = "1.0.13"
  agent_id                = coder_agent.main.id
  folder                  = "/home/${local.username}/modules"
  install_prefix          = "/home/${local.username}/.code-server"
  extensions_dir          = "/home/${local.username}/.code-server/extensions"
  use_cached              = true
  auto_install_extensions = true
}

Example output

Screenshot 2024-04-18 at 11 03 07 PM

NOTES

closes #206

michaelbrewer commented 2 months ago

@code-asher i am not 100% convinced about the flag auto_install_extensions, if it makes sense i will keep it,

I will back port these features to the vscode-web module to people can easily switch between the 2 versions.

code-asher commented 2 months ago

i am not 100% convinced about the flag auto_install_extensions, if it makes sense i will keep it,

I think code-server/VS Code already offers to install the recommended extensions after you open a project, right? But this can cut down on the perceived time it takes to get coding, so I feel it is a worthwhile addition.

michaelbrewer commented 2 months ago

More of the naming of the flag.

I like the intention of this, as it allows for the get repo to specify what it wants.

code-asher commented 2 months ago

More of the naming of the flag.

Ohh yeah I see, I think the name is good.