Skip to content

Support enumDescriptions custom keyword #99

Description

@Suyog241005

Part of #85.

VS Code supports a custom enumDescriptions keyword: an array of plain-text strings, positionally matched to the values in enum, used to describe each allowed value.

Example

{
  "type": "string",
  "enum": ["debug", "info", "error"],
  "enumDescriptions": [
    "Log everything",
    "Log informational messages and above",
    "Log errors only"
  ]
}

Expected behavior

  • Value completion: each enum completion item includes the matching enumDescriptions entry as its documentation.
  • If enumDescriptions is shorter than enum, values without a matching entry get no documentation. Extra entries are ignored.
  • Schemas without enumDescriptions are unaffected.

Scope question

VS Code only uses enumDescriptions in completion. Should hover over an enum value also show its description, or keep this issue to completion only? I'll start with completion unless if hover should also be included.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions