vscode-yaml
vscode-yaml copied to clipboard
[Regression] Intellisense/Auto-Completion won't work for subschemas with type array since 1.11
Describe the bug
We rely on custom yaml configuration to setup particular systems. We validate these yaml files with json schema, and rely on the Intellisense/Autocompletion feature of this yaml extensions to expose the possible values, alongside a relevant description, since we have hundreds of values which need to be correct.
We recently had reports of developers that when accessing Intellisense (Control + Space ) , they suddenly had an empty box, with no longer the possible values.
Further investigation showed that the fault was on vscode auto-updating the YAML extension to 1.11 . Reverting to 1.10 succesfully restored functionality, but this is breaking workflows revolving around dynamic development environments, in the browser for example. Since we cannot specify required version in suggested workspace extensions ( .vscode/extensions.json), the remote environment will try to setup with the latest of every extensions - thus requiring a manual downgrade step.
Expected Behavior
Before 1.10
✅ String type with const

✅ Array type with const

✅ Array type with enum

Current Behavior
From 1.11
✅ String type with const

❌ Array type with const

Note that the validation aspect still works :
Note that the validation aspect still works, despite the autocompletion issue :
⚠️ Array type with const - validates, but does not autocomplete

✅ Array type with enum

Steps to Reproduce
- Create a workspace, where VSCode will validate yaml files using the demo schema below (in our case using
.vscode/settings.json). - Make sure you use the YAML extension version
1.10.1- may need downgrading on the extension page - Create a yaml file and test the validation and autocompletion
- Upgrade to
1.11and compare behaviours
⚙️ settings.json
{
"yaml.schemas": {
".\\custom_json_schema.json": "*.yaml",
}
}
📝 Demonstration schema
{
"title": "Demonstration Schema",
"description": "Demonstrates Validation Glitch",
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"required": [
"string_example",
"array_example",
"array_enum_example"
],
"properties": {
"string_example": {
"title": "Constants for string",
"type": "string",
"description": "Shows behaviour when using a string with constants subschemas",
"oneOf": [
{
"const": "Option 1",
"description": "Sample Option 1",
"markdownDescription": "_Sample Option 1_"
},
{
"const": "Option 2",
"description": "Sample Option 2",
"markdownDescription": "_Sample Option 2_"
}
]
},
"array_example": {
"title": "Constants for array",
"type": "array",
"description": "Shows behaviour when using an array with constants subschemas",
"items": {
"type": "string",
"anyOf": [
{
"const": "Option 1",
"description": "Sample Option 1",
"markdownDescription": "_Sample Option 1_"
},
{
"const": "Option 2",
"description": "Sample Option 2",
"markdownDescription": "_Sample Option 2_"
}
]
}
},
"array_enum_example": {
"title": "Enum for array",
"type": "array",
"description": "Shows behaviour when using an enum with constants subschemas",
"items": {
"type": "string",
"enum": ["Option 1", "Option 2"]
}
}
}
}
Environment
- [x] Windows
- [ ] Mac
- [ ] Linux
- [ ] other (please specify)
This is still broken as of 1.12.1 . Could someone have a look at it, since a list of validated values is most likely to be useful to other users, and this was a supported feature until recently ?
Confirmed to be broken as of 1.12.2 . I also try to go through the settings in case something new was added. If the repo maintainer have acked the regression, could you please comment ? This is impacting moving to remote development with web ides, since customized yaml schemas are a big part of our deployment (and I assume many others, who rely on the extension in their day to day) .
@gorkem / @msivasubramaniaan kindly pinging here for visibility, this is very impacting and is clearly a bug with autocompletion.
This is affecting our team as well and is a fairly frustrating bug
@gorkem / @msivasubramaniaan sorry to bother again, but tested on 1.13 it's still broken. Having this structure is the only way to allow descriptions for multiple options for each entry of a list, as enum does not support descriptions. It's pretty certain there are others who will hit this, as was commented by another user.
Currently I had to retrain a whole dev team to stick to 1.10 to not block operations. Let me know if I can inform or support in any other way.
@gorkem / @msivasubramaniaan Qualified as still broken for 1.14. Probably a regression inherited from https://github.com/redhat-developer/yaml-language-server . This is still problematic for developer expererience on our end.