Skip to content

Add JSON Schema#994

Open
ShadiestGoat wants to merge 2 commits intocastwide:masterfrom
ShadiestGoat:add-json-schema
Open

Add JSON Schema#994
ShadiestGoat wants to merge 2 commits intocastwide:masterfrom
ShadiestGoat:add-json-schema

Conversation

@ShadiestGoat
Copy link
Contributor

Adds a JSON Schema for the config file, including docs for each field

Note: yaml lang server had a regression and can't display descriptions for consts/enums in arrays on latest stable version. I have a PR with a potential fix, but we shall see how that goes.

Preview:

image

Docs were mostly pulled from the solargraph site

Only thing unclear to me, what is the "update_errors" reporter?

@apiology
Copy link
Contributor

apiology commented Jul 9, 2025

Nice!

I worry about the schema falling out of date as we add things to the config; it'd be easy to forget that it exists I think.

Potential ways to avoid: validate against schema when we generate our default config, use schema to give user good error messages when reading in config.

@castwide
Copy link
Owner

castwide commented Jul 9, 2025

Only thing unclear to me, what is the "update_errors" reporter?

When a source code update introduces a syntax error (e.g., an incomplete code snippet that can't be parsed yet), it gets temporarily "repaired" so the source map still works. The update_errors reporter tracks the locations in source that are currently under repair.

@ShadiestGoat
Copy link
Contributor Author

@castwide I finished the schema with the additional info

@castwide
Copy link
Owner

castwide commented Jul 9, 2025

I definitely like the idea of validating the schema. One concern I have, specifically with reporters, is that extensions can add their own reporters. If I'm using solargraph-reek, is there a way to make 'reek' appear as an available reporter?

Edit: at the very least, adding 'reek' to the reporters shouldn't be invalid.

@ShadiestGoat
Copy link
Contributor Author

Youre right - afaik, its not possible to actually like "register" extra schema modules. I'll add a fallback value.

In addition to this, what do you think about pre-registering values for well known modules, like reek/rails/rspec?

@@ -0,0 +1 @@
ruby 3.2.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind opening a separate PR with an explanation if you feel this should be part of the repo?

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.

3 participants