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:
- 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.
- 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.
Relates to #85.
Background & Research
In
vscode-json-languageservice,deprecationMessageis a custom schema keyword used to indicate that a property is deprecated and provide migration guidance or rationale.When present in a schema:
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'sCompletionItemTag.Deprecated(1), displaying them with strikethrough styling in editor completion lists, and displays the deprecation message in item documentation.deprecated: true(e.g. Draft 2019-09 / 2020-12) when no custom message is supplied.Description
Support VSCode's custom
deprecationMessagekeyword (as well asmarkdownDeprecationMessage) inhyperjump-json-language-server:⚠️ **Deprecated:** <message>).CompletionItemTag.Deprecatedand attach the message to item documentation.Proposed Scope
Hover.tsto inspect annotations forunknown#deprecationMessage,unknown#markdownDeprecationMessage, and standarddeprecated.CompletionEvaluationPlugin.tsto record deprecation status inPropertyValueInfofrom schema AST.PropertyCompletion.tsto settags: [CompletionItemTag.Deprecated]anddocumentation.Hover.test.tsandPropertyCompletion.test.ts.