question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Objects with numeric or boolean enum values don't render in the Settings editor

See original GitHub issue

according to docs

Other types, such as object and array, aren’t exposed directly in the settings UI, and can only be modified by editing the JSON directly. Instead of controls for editing them, users will see a link to Edit in settings.json as shown in the screenshot above.

which is incorrect as we can access & change it though the UI, but with some limitation to the ext creator 😢 , as atm we can only have items of type string & when trying to use something else like boolean (which actually works) vscode will show an error of mismatch value type because of the outdated scheme.

the end goal is to have a dropdown list where user can chose meaningful options instead of having to edit it manually.

  • example for ext config
"autoPosthtml.togglePlugins": {
    "type": "object",
    "description": "toggle plugin",
    "default": {
        "schemes": true,
    },
    "properties": {
        "schemes": {
            "type": "string",
            "default": true,
            "enum": [
                true,
                false
            ],
            "description": "enable/disable schemes"
        },
    }
},
  • settings ui editor Screen Shot 2020-12-30 at 2 39 52 PM

  • but because of the current limitation we will get an error in the settings file Screen Shot 2020-12-30 at 2 43 19 PM

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
roblourenscommented, Dec 30, 2020

Oh, you just want to use other types in the settings editor? Yes that isn’t supported yet. I don’t think there is an open feature request for it.

0reactions
rzhao271commented, Dec 8, 2022

I confirmed the following:

  • Numeric and boolean enum settings render in the Settings editor
  • Numeric and bool object settings render in the Settings editor
  • Objects with numeric or boolean enum values don’t render in the Settings editor
Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I guarantee that my enums definition doesn't change ...
I'm not sure I agree with the "meaningful string" suggestion. Enums should not be thought of as strings or numbers; they are abstract...
Read more >
Integer enum with named items · Issue #681 - GitHub
I would like to propose a new field called enumNames. Example: definitions: weather: type: object required: - type properties: type: type: ...
Read more >
Handbook - Enums - TypeScript
String enums allow you to give a meaningful and readable value when your code runs, independent of the name of the enum member...
Read more >
Put the TypeScript enums and Booleans away - LogRocket Blog
Booleans do not model state​​ For example, if we tried this approach: const isAuthenticated: boolean = false; const isErrored: boolean = false; ...
Read more >
Tag Helpers in forms in ASP.NET Core - Microsoft Learn
Describes the built-in Tag Helpers used with Forms.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found