-
Notifications
You must be signed in to change notification settings - Fork 373
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
docs: Expose config-schema.json
in the docs site
#5347
base: main
Are you sure you want to change the base?
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There are a few other ways to do this (by adding other mkdocss plugins that would copy the file into place after the build), but this is the simplest path forward and I figured it'd give a good starting point for conversation. Let me know if we don't want a symlink in the repo like this, and I can work another version. |
2ec04dd
to
41f7e15
Compare
config-schema.json
in the docs site
OK, just updated and marked as ready for review. I added a brief blurb to the CHANGELOG and also added a section to |
When landed and published, this will expose the config file as: https://jj-vcs.github.io/jj/latest/config-schema.json Exposing the schema like that will allow users to reference in their `~/.config/jj/config.toml` like: ```toml "$schema" = 'https://jj-vcs.github.io/jj/latest/config-schema.json' ``` At which point any user with a configured LSP for TOML files will get inline documentation, suggestions on valid keys, &c.
41f7e15
to
3af6142
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really cool feature I didn't know existed, thanks!
|
||
```toml | ||
# Get editor completions based on the config schema | ||
"$schema" = "https://jj-vcs.github.io/jj/latest/config-schema.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, users would be able to target the version of the tool they have, but that's probably not always possible (i.e. git compiled versions?) We could figure that out later on, in any case!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once we have it deployed for a tagged release we can start updating to use the version (the same way the rest of the docs are versioned), it just won't work for any versions prior (unless we have a system for back porting that kind of thing?).
@@ -77,6 +77,14 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | |||
* New `git.sign-on-push` config option to automatically sign commits which are being | |||
pushed to a Git remote. | |||
|
|||
* Publish `config-schema.json` in the documentation site. Users can now reference |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd probably say:
The Jujutsu documentation site now publishes a schema for the official configuration file, which can be integrated into your editor for autocomplete, inline errors, and more. Please see the documentation for more on this.
i.e. we normally would link to the docs elsewhere, rather than including the example inline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, thank you!! I wasn't quite sure about how specific to be here. Will update shortly.
When landed and published, this will expose the config file as:
https://jj-vcs.github.io/jj/latest/config-schema.json
Exposing the schema like that will allow users to reference in their
~/.config/jj/config.toml
like:At which point any user with a configured LSP for TOML files will get inline documentation, suggestions on valid keys, &c.
Examples
Some example screenshots of this working in my local NeoVim setup (using a local
mkdocs serve
of these changes), but the same works in any editor with an LSP setup for TOML files.Checklist
If applicable:
CHANGELOG.md