redhat-developer / redhat-developer/vscode-yaml
Description not showing for some fields
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 829
- Forks
- 260
- Avg merge
- 5h 43m
- Merged PRs (30d)
- 1
Description
Describe the bug
I have a JSON schema generated by Pydantic has descriptions of certain fields. When I create a json file and validate it with the schema, the descriptions show in VSCode without exception. However, when using the YAML extension and creating a YAML file, some of the descriptions display, and some of them do not (see screenshots below).
Expected Behavior
The description should be present when hovering over all fields that contain a description in the schema.
Current Behavior
Only certain fields display the description.
Steps to Reproduce
- Here is an example schema:
{
"$defs": {
"FastSpeech2TrainingConfig": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"batch_size": {
"default": 16,
"description": "The number of samples to include in each batch when training. If you are running out of memory, consider lowering your batch_size.",
"title": "Batch Size",
"type": "integer"
},
"save_top_k_ckpts": {
"default": 5,
"description": "The number of checkpoints to save.",
"title": "Save Top K Ckpts",
"type": "integer"
},
"ckpt_steps": {
"anyOf": [{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "The interval (in steps) for saving a checkpoint. By default checkpoints are saved every epoch using the 'ckpt_epochs' hyperparameter",
"title": "Ckpt Steps"
},
"ckpt_epochs": {
"anyOf": [{
"type": "integer"
},
{
"type": "null"
}
],
"default": 1,
"description": "The interval (in epochs) for saving a checkpoint. You can also save checkpoints after n steps by using 'ckpt_steps'",
"title": "Ckpt Epochs"
},
"$schema": "http://json-schema.org/draft-07/schema#"
}
}
},
"additionalProperties": false,
"properties": {
"path_to_model_config_file": {
"anyOf": [{
"format": "file-path",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Path To Model Config File"
},
"training": {
"$ref": "#/$defs/FastSpeech2TrainingConfig"
},
"path_to_training_config_file": {
"anyOf": [{
"format": "file-path",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Path To Training Config File"
},
"path_to_preprocessing_config_file": {
"anyOf": [{
"format": "file-path",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Path To Preprocessing Config File"
},
"path_to_text_config_file": {
"anyOf": [{
"format": "file-path",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Path To Text Config File"
}
},
"title": "FastSpeech2Config",
"type": "object"
}
- Create a json file:
{
"$schema": "/path/to/the/schema/above.json",
"training": { "ckpt_epochs": 1 }
}
- Hover over the "ckpt_epochs" key and you will see a description:
- Create a yaml file and associate it with the same schema, and you will see a description for some fields (i.e.
batch_sizeshown below), but you will not see a description for others (e.g.ckpt_epochs)
Environment
Tested on macOS Monterey and Windows. For Mac:
Version: 1.84.2 (Universal)
Commit: 1a5daa3a0231a0fbba4f14db7ec463cf99d7768e
Date: 2023-11-09T10:52:33.687Z (1 wk ago)
Electron: 25.9.2
ElectronBuildId: 24603566
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Darwin arm64 21.6.0
- Windows
- Mac
- Linux
- other (please specify)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the supplied schema in the YAML extension and compare hover results for batch_size with ckpt_epochs, especially their direct property versus anyOf and $ref structures. No source files or tests are named in the issue; done means descriptions appear when hovering every field that has a schema description, as they do in the JSON case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100