Leverage schemars to generate a JSON Schema from our structs for
configurations and those occurring within them.
Regarding dependency on an alpha version of schemars: Reading the
road to 1.0 issue
I don’t expect that we would be affected by breakage.
We use pretty standard/core parts of the API that probably are most stable.
The output of rad config schema can be used by editors to provide a
smoother editing experience for the configuration file. Discovery of
attributes (both keys and values) is greatly improved with the schema
helping in the background.
Refer to:
- https://json-schema.org
- https://code.visualstudio.com/docs/languages/json#_json-schemas-and-settings
- https://schemastore.org
Original description by did:key:z6MkjFMAoA3hUG6tM7Wprn7dh7bquLpmN1f3yECbwkyweQnJ follows:
This will be a great addition especially for LSP users who dont want to read through all the code to know what options can be changed where and how.
How it works: You simply pipe the output into xyz.json and then add to your config: “$schema”: “/path/to/xyz.json” and if you have a working json LSP you’ll get docs, etc. for your config, meaning we’ll have to write a lot less docs in the future :)
Leverage schemars to generate a JSON Schema from our structs for
configurations and those occurring within them.
Regarding dependency on an alpha version of schemars: Reading the
road to 1.0 issue
I don’t expect that we would be affected by breakage.
We use pretty standard/core parts of the API that probably are most stable.
The output of rad config schema can be used by editors to provide a
smoother editing experience for the configuration file. Discovery of
attributes (both keys and values) is greatly improved with the schema
helping in the background.
Refer to:
- https://json-schema.org
- https://code.visualstudio.com/docs/languages/json#_json-schemas-and-settings
- https://schemastore.org
Original description by did:key:z6MkjFMAoA3hUG6tM7Wprn7dh7bquLpmN1f3yECbwkyweQnJ follows:
This will be a great addition especially for LSP users who dont want to read through all the code to know what options can be changed where and how.
How it works: You simply pipe the output into xyz.json and then add to your config: “$schema”: “/path/to/xyz.json” and if you have a working json LSP you’ll get docs, etc. for your config, meaning we’ll have to write a lot less docs in the future :)
thanks a lot for your improvements lorenz
thanks a lot for your improvements
Make schemars an optional dependency.
Rebased
Changes:
- Small fix to spacing in
radicle/Cargo.toml