Skip to content

Show default and examples in hover #88

Description

@srivastava-diya

Description

Hover currently shows only title and description. JSON Schema's default and examples are also annotations and are already available through getAnnotations(), but we ignore them. Showing them would tell users what value a property takes if omitted, and what valid values look like.

Proposed Scope

  • In Hover.ts, read https://json-schema.org/keyword/default and https://json-schema.org/keyword/examples alongside the existing title/description handling.
  • Render them as formatted JSON in the Markdown hover (examples is an array).
  • Add tests in Hover.test.ts, including a property that has a default but no description etc.

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