vscode-yaml
vscode-yaml copied to clipboard
Auto-reload yaml schema if edited in the workspace
when developing a yaml schema, it would be useful that when it is modified, the modified file is picked up automatically. Currently, I need to restart VS Code.
Use case:
- create a yaml schema
- modify settings yaml.schemas to point to it
- open a file X.yaml matching the glob pattern provided for yaml.schemas
- call completion in the X.yaml file
- modify the yaml schema, save
- go back to X.yaml editor --> have completion/validation corresponding to the modified and saved yaml schema
Just doing a window reload works as well, but that kills my bootstrapped shell (that holds many env settings), which is not nice.
Reloading the window after schema modifications shouldn't be the proper way of updating the validation. There should be an auto-reload mechanism upon schema change, or at least a command to reload schemas manually.
As a workaround, if you remove the file manually from your settings.json
, save it, and then add it back, VS will force reload the new schema on disk.
I notice automatic reloading since a couple of weeks...so this is resolved imo
Not resolved for me here on Mac, also a duplicate has been opened after @Morriz comment: https://github.com/redhat-developer/vscode-yaml/issues/639
I can confirm the issue persists on Mac. Particularly when using the inline # yaml-language-server: $schema=...
method. Current workaround for me is to (tediously):
- Remove the inline comment.
- # yaml-language-server: $schema=path/to/my.schema.json --- $schema: https://json-schema.org/draft-07/schema
- Apply a random schema using schema-selector in the bottom right corner.
and...
- Re-adding the inline comment.
+ # yaml-language-server: $schema=path/to/my.schema.json --- $schema: https://json-schema.org/draft-07/schema
Not fun, nor ideal, when moving at a fast-pace.