-
Notifications
You must be signed in to change notification settings - Fork 315
Open
Description
Describe the bug
Support for the propertyNames keyword seems to have been introduced in #720.
However, it seems the actual implementation is only providing the title of the propertyNames schema as completion, rather than the schema enum values themselves.
This most likely means the suggested completion will be an invalid value, as more often than not the name of the schema is not itself an actual permitted value.
Example Schema
schema.json
{
"$defs": {
"EventName": {
"enum": [
"None",
"Event1",
"Event2"
],
"title": "EventName",
"type": "string"
}
},
"properties": {
"events": {
"additionalProperties": {
"type": "integer"
},
"propertyNames": {
"$ref": "#/$defs/EventName"
},
"title": "Events",
"type": "object"
}
},
"required": [
"events"
],
"title": "FooContainer",
"type": "object"
}Expected Behavior
Given the above schema with propertyNames, provide as completion the list of valid property names.
Current Behavior
Only the name of the schema definition is offered as completion:
Steps to Reproduce
- Save the schema
schema.jsoninto a local file. - Create a new YAML file, e.g.
config.yaml - Declare
schema.jsonas the inline schema for the yaml language server:
# yaml-language-server: $schema=schema.json
- Ask for a completion when hovering over the space where typing dictionary keys.
Environment
- Windows
- Mac
- Linux
- other (please specify)
Metadata
Metadata
Assignees
Labels
No labels