Skip to content

[FEATURE]: JSONC support for user themes. #4927

@ariane-emory

Description

@ariane-emory

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Since the opencode.json/opencode.jsonc can be either a plain JSON file or a JSONC file, it can be a little surprising to assume that the same is true of themes and accidentally discover that user themes can only be plain JSON files while editing one's custom them files.

Adding support for user themes written in JSONC would improve consistency and adherence to the principle of least surprise by giving users' custom theme files the same treatment that the opencode.json/opencode.jsonc get and permitting them to be either plain JSON or JSONC files.

This can improve UX whileperforming work adjusting custom theme files more ergonomic, since it can be very convenient to be able comment lines in a theme file in or out while adjusting its aesthetics.

The current code used to parse the opencode.jsonc JSONC file includes some logic related to the handling of environment variables and the inclusion of external files, this behaviour is is not required for JSONC user theme files and MUST NOT be enabled for them. This could necessitate splitting the logic for reading JSONC files into two functions: one for config files that includes this special handling of environment variables and external files, and one for other JSONC files (such as user themes) that omits it. Alternatively it could involve adding an additional boolean parameter to the function for parsing JSONC files that controls whether the special handling of environment variables/external files is enabled or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionUsed for feature requests, proposals, ideas, etc. Open discussion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions