Support deprecated - #136
Open
Suyog241005 wants to merge 4 commits into
Open
Suyog241005 wants to merge 4 commits into
Suyog241005 wants to merge 4 commits into
Conversation
Registers deprecationMessage and markdownDeprecationMessage in the vscode vocabulary and reads them (or the standard deprecated keyword) from annotations in Hover.
Adds DeprecatedDiagnosticsProvider, which walks the document and emits a Warning tagged Deprecated for any location whose annotations carry deprecationMessage, markdownDeprecationMessage, or deprecated: true.
AnnotationsEvaluationPlugin now also builds annotations for declared properties absent from the instance so completion candidates can be checked for deprecation.
Contributor
Author
|
Hi @jdesrosiers, this is ready for review whenever you have time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for the standard
deprecatedkeyword and VS Code's customdeprecationMessageandmarkdownDeprecationMessagekeywords.What changed
deprecationMessageandmarkdownDeprecationMessagein the vscode vocabulary, with meta-schema entries.getDeprecation, a small helper that reads the vocabulary keyword URIs, theirunknown#fallbacks, and the standarddeprecatedkeyword from annotations. All features below use it.⚠️ **Deprecated:** <message>, or⚠️ **Deprecated**when onlydeprecated: trueis set.markdownDeprecationMessagetakes precedence overdeprecationMessage.DeprecatedDiagnosticsProviderreports a Warning taggedDeprecatedfor every deprecated location. For property values the range covers the key, matching VS Code. For other values (e.g. array items) it covers the value itself.CompletionItemTag.Deprecatedand the message as markdown documentation. To support this,AnnotationsEvaluationPluginnow also builds annotations for declared properties absent from the instance, since those are the completion candidates.Screenshots
Diagnostics and hover:
Property completions:
Out of scope
As discussed in #86, tagging value completions for a single deprecated
anyOfalternative is left for a follow-up.Closes #97
Closes #86