Skip to content
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

Add YAML/JSON config support additionally (part 1): add JSON schema #991

Closed
wants to merge 34 commits into from
Closed

Conversation

EmilyGraceSeville7cf
Copy link

@EmilyGraceSeville7cf EmilyGraceSeville7cf commented Dec 13, 2022

Related Issue/Addition to code

  • Add JSON schema for INI config that will be referenced then in SchemaStore to provide autocompletion for YAML/JSON-based configs.
  • Create shell script to automatically generate skeleton of JSON schema.
  • Create shell script to automatically update existing JSON schema.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Why is this change needed?

It's needed because neither YAML Red Hat extension nor Even better TOML tamasfe extension for VS Code now doesn't support INI files autocompletion. Also JSON-schema based configs are easier to validate.

Additional Info

By all means I think INI support will be added later to one of this extensions or another one. But now the most easy way to provide hints for configs is to create JSON schema and add new config's types support for this tool.

Checklist:

  • My code follows the style guidelines of this project and I have read CONTRIBUTING.md
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Screenshots

JSON schema in action:

image

image

INI parsing result to speed up JSON schema update (ranges and example values are parsed correctly):

image

Next PRs

  • Add support for JSON/YAML configs as autocomplete is possible for them.

Who gonna maintain JSON-schema related stuff?

Me.

@EmilyGraceSeville7cf EmilyGraceSeville7cf marked this pull request as draft December 13, 2022 06:30
Emily Grace Seville and others added 7 commits December 15, 2022 16:21
Co-authored-by: Firecul <Firecul666@gmail.com>
- use `<...>` for values should be put as `examples`
- use `[...]` for values should be interpreted as:
  - string, number literals
  - closed range literals `[x-y]` with both borders included
  - closed-open range literals `[x-infinity]` with first border included
    - use `infinity` keyword as the second argument in such ranges
- reason: make parsing process reliable
- `is_value_in_array`
@ghost ghost closed this by deleting the head repository Apr 20, 2023
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants