Skip to content

bug(code-server): Inability to set object values in settings #296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
phorcys420 opened this issue Sep 22, 2024 · 5 comments · Fixed by #368
Closed

bug(code-server): Inability to set object values in settings #296

phorcys420 opened this issue Sep 22, 2024 · 5 comments · Fixed by #368
Assignees
Labels
good first issue Good for newcomers

Comments

@phorcys420
Copy link
Member

Discord Thread


The type of the settings variable is map(string) and therefore does not allow you to set settings like files.exclude which takes in an object.

You would want to set the value like this, but the type doesn't allow you to do so.

settings = {
    "files.exclude" = {
      "**/.*": true
    },
    "workbench.colorTheme" = "Default Dark Modern"
}

I think all that has to be done is set the variable's type to map(any).

@coder-labeler coder-labeler bot added the bug label Sep 22, 2024
@phorcys420
Copy link
Member Author

@matifali, could you take a look?
it should be a relatively low effort fix, i just won't have time to look into it for a bit

@matifali
Copy link
Member

matifali commented Dec 3, 2024

From #357 (comment)

L.S.

I found the following bug. The settings variable of the code-server module is currently typed as [map(string).](https://github.com/coder/modules/blob/675c82367a3d53be5f719fca4444fbf5b0ce22ac/code-server/main.tf#L42) This is a bug, in my opinion, because it does now allow settings with subkeys to be used, which causes a Terraform error. After all, the value is not a string.

settings = {
  "yaml.customTags": [
    "!reference sequence",
    "!vault scalar",
    "inputs sequence"
  ]
}

FIX: To allow vscode setting to be set correctly, the type of the variable should be map(object).

Please advice.

@matifali matifali added the good first issue Good for newcomers label Dec 3, 2024
@gjrtimmer
Copy link

gjrtimmer commented Dec 3, 2024

It require some investigation, however as @phorcys420 noted and my analysis, the type of the settings variable should either be:

map(any) OR map(object) I think for now that @phorcys420 is right and it should be map(any)

@gjrtimmer
Copy link

So I built the module locally and figured out what the variable type has to be; it must be any; actually; otherwise, it will not work. It requires any because the settings json can be comprised of both key/value os of key/object, in the same json document. Therefor any kind of map will not work.

Type must be: any

@phorcys420 comments?

@phorcys420 phorcys420 self-assigned this Dec 6, 2024
@link-webcreations
Copy link

Hello, the same issue exist also for the module registry.coder.com/modules/vscode-web :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants