Skip to content

Support deprecationMessage custom keyword #97

Description

@Suyog241005

Relates to #85.

Background & Research

In vscode-json-languageservice, deprecationMessage is a custom schema keyword used to indicate that a property is deprecated and provide migration guidance or rationale.
When present in a schema:

  1. Hover Tooltips (textDocument/hover): Displays a deprecation notice containing the custom message alongside the title and description. 2. Property Completion (textDocument/completion): Flags deprecated properties with LSP's CompletionItemTag.Deprecated (1), displaying them with strikethrough styling in editor completion lists, and displays the deprecation message in item documentation.
  2. Standard Fallback: Gracefully handles standard JSON Schema deprecated: true (e.g. Draft 2019-09 / 2020-12) when no custom message is supplied.

Description

Support VSCode's custom deprecationMessage keyword (as well as markdownDeprecationMessage) in hyperjump-json-language-server:

  • Hovering over a deprecated property key or value will render a prominent deprecation notice (⚠️ **Deprecated:** <message>).
  • Property completion proposals will flag deprecated properties with CompletionItemTag.Deprecated and attach the message to item documentation.

Proposed Scope

  • Update Hover.ts to inspect annotations for unknown#deprecationMessage, unknown#markdownDeprecationMessage, and standard deprecated.
  • Update CompletionEvaluationPlugin.ts to record deprecation status in PropertyValueInfo from schema AST.
  • Update PropertyCompletion.ts to set tags: [CompletionItemTag.Deprecated] and documentation.
  • Add comprehensive unit tests in Hover.test.ts and PropertyCompletion.test.ts.

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