feat(hover): add missing descriptions for older json schema drafts#266
feat(hover): add missing descriptions for older json schema drafts#266adityayadav-dev wants to merge 1 commit intohyperjump-io:mainfrom
Conversation
|
Hey @jdesrosiers , I have made the changes. Please take a look when you have time. Thanks! |
|
|
||
| // Draft-04 | ||
| "https://json-schema.org/keyword/draft-04/id": ``, | ||
| "https://json-schema.org/keyword/draft-04/id": `This keyword declares an identifier for the schema resource. Learn more: https://www.learnjsonschema.com/2020-12/core/id/`, |
There was a problem hiding this comment.
This points to the 2020-12 documentation. It should point to draft-07. It's the same for draft-04/6/7, so let's choose the latest version. After draft-07, it works differently, so we shouldn't point to 2020-12.
| // Draft-04 | ||
| "https://json-schema.org/keyword/draft-04/id": ``, | ||
| "https://json-schema.org/keyword/draft-04/id": `This keyword declares an identifier for the schema resource. Learn more: https://www.learnjsonschema.com/2020-12/core/id/`, | ||
| "https://json-schema.org/keyword/draft-04/ref": `This keyword is used to reference a statically identified schema. Learn more: https://www.learnjsonschema.com/2020-12/core/ref/`, |
There was a problem hiding this comment.
This should point to the draft-07 documentation.
| "https://json-schema.org/keyword/draft-04/dependencies": ``, | ||
| "https://json-schema.org/keyword/draft-04/exclusiveMaximum": ``, | ||
| "https://json-schema.org/keyword/draft-04/exclusiveMinimum": ``, | ||
| "https://json-schema.org/keyword/draft-04/dependencies": `This keyword specifies rules that are evaluated if the instance is an object and contains a certain property. Learn more: https://json-schema.org/understanding-json-schema/reference/object#dependencies`, |
There was a problem hiding this comment.
Let's be consistent about referencing learnjsonschema.com. Use the draft-07 link.
| "https://json-schema.org/keyword/draft-04/exclusiveMaximum": `If true, validation succeeds if the numeric instance is strictly less than the given maximum. Learn more: https://json-schema.org/understanding-json-schema/reference/numeric#range`, | ||
| "https://json-schema.org/keyword/draft-04/exclusiveMinimum": `If true, validation succeeds if the numeric instance is strictly greater than the given minimum. Learn more: https://json-schema.org/understanding-json-schema/reference/numeric#range`, |
There was a problem hiding this comment.
Use the learnjsonschema.com link. This one should use link for draft-04.
| "https://json-schema.org/keyword/draft-04/maximum": `Validation succeeds if the numeric instance is less than or equal to the given number. Learn more: https://www.learnjsonschema.com/2020-12/validation/maximum/`, | ||
| "https://json-schema.org/keyword/draft-04/minimum": `Validation succeeds if the numeric instance is greater than or equal to the given number. Learn more: https://www.learnjsonschema.com/2020-12/validation/minimum/`, |
There was a problem hiding this comment.
This needs to use link for draft-04.
| "https://json-schema.org/keyword/draft-06/$id": `This keyword declares an identifier for the schema resource. Learn more: https://www.learnjsonschema.com/2020-12/core/id/`, | ||
| "https://json-schema.org/keyword/draft-06/contains": `Validation succeeds if the instance contains an element that validates against this schema. Learn more: https://www.learnjsonschema.com/2020-12/applicator/contains/`, | ||
| "https://json-schema.org/keyword/draft-06/dependencies": `This keyword specifies rules that are evaluated if the instance is an object and contains a certain property. Learn more: https://json-schema.org/understanding-json-schema/reference/object#dependencies`, | ||
|
|
||
| // Draft-7 | ||
| "https://json-schema.org/keyword/draft-07/$id": `This keyword declares an identifier for the schema resource. Learn more: https://www.learnjsonschema.com/2020-12/core/id/`, | ||
| "https://json-schema.org/keyword/draft-07/dependencies": `This keyword specifies rules that are evaluated if the instance is an object and contains a certain property. Learn more: https://json-schema.org/understanding-json-schema/reference/object#dependencies`, |
There was a problem hiding this comment.
Remove these additions. There are no keywords with those identifiers.
Summary
Adds missing hover tooltip descriptions for several keywords in draft-04, draft-06, and draft-07 that were previously left blank or missing. Also uncomments the corresponding test assertions that were marked as TODO.
Closes #256
Changes
language-server/src/features/hover.jsdraft-04 — filled in empty descriptions for:
id— identifier for the schema resourcedependencies— rules evaluated when an object contains a certain propertyexclusiveMaximum— strict less-than validation (boolean form in draft-04)exclusiveMinimum— strict greater-than validation (boolean form in draft-04)maximum— less-than-or-equal validationminimum— greater-than-or-equal validationdraft-06 — added new entries for:
$id— identifier for the schema resourcedependencies— rules evaluated when an object contains a certain propertydraft-07 — added new entries for:
$id— identifier for the schema resourcedependencies— rules evaluated when an object contains a certain propertylanguage-server/src/features/hover.test.tsUncommented all TODO test assertions so the previously skipped keywords are now regression-tested:
$id,dependencies$id,dependenciesid,maximum,exclusiveMaximum,minimum,exclusiveMinimum,dependenciesTesting
All 5768 tests pass (24 test files), including the newly enabled hover assertions for all three drafts.