coder / modules

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

VS Code Web: Add support for `settings` #196

Closed michaelbrewer closed 5 months ago

michaelbrewer commented 6 months ago

Add support for pre-configuring settings with vscode-web like code-server

module "vscode-web" {
  source     = "registry.coder.com/modules/vscode-web/coder"
  version    = "1.0.8"
  agent_id   = coder_agent.example.id
  extensions = ["dracula-theme.theme-dracula"]
  settings = {
    "workbench.colorTheme" = "Dracula"
  }
  accept_license = true
}
matifali commented 6 months ago

Let us wait for @code-asher's views on what's the difference between User and Machine settings and which one should we use.

michaelbrewer commented 6 months ago

When i saved to User it would not take effect on vscode-web, i think they want you to use a github account for syncing settings or it stores it in the browser application data?

Only Machine would actually update.

code-asher commented 6 months ago

User might be safer, as there are some settings that cannot be applied through Machine.

Only Machine would actually update.

Are there settings that only work in Machine but not User? I thought it was the other way around.

I think maybe we could just expose both and let the template author decide where to put them. settings.user and settings.machine maybe.

code-asher commented 6 months ago

Oh sorry, this is VS Code web, not code-server!

Yes, you are right, upstream's web version only reads browser storage for user settings, it does not read User settings on the disk. (We patch this in code-server so it reads from the disk.)

So yes, Machine is the only option here.

matifali commented 6 months ago

User might be safer, as there are some settings that cannot be applied through Machine.

Only Machine would actually update.

Are there settings that only work in Machine but not User? I thought it was the other way around.

I think maybe we could just expose both and let the template author decide where to put them. settings.user and settings.machine maybe.

exposing both settings.user and settings.machine is a great idea for another PR. Could be added to code-server too.