Propagate deprecated attribute information on functions to Autocomplete entries#2159
Open
JohnnyMorganz wants to merge 9 commits intoluau-lang:masterfrom
Open
Propagate deprecated attribute information on functions to Autocomplete entries#2159JohnnyMorganz wants to merge 9 commits intoluau-lang:masterfrom
JohnnyMorganz wants to merge 9 commits intoluau-lang:masterfrom
Conversation
Contributor
Author
|
Failing test case is due to #2162 |
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.
This PR fixes #2158 by checking the type information in an AutocompleteEntry to determine if it is a function (or intersection of functions) that is marked as deprecated. We then store this in the entry.deprecated field.
Alternatives considered
As seen in the commit history, my original thought was that we should propagate the deprecated attribute onto
BindingsandProps. However, this end up having a couple of issues:deprecatedSuggestionin the Binding / Props. If so, how - should it be the same string constructed by the Linter?props.deprecatedtakes priority over the type-based deprecated information. This meant that we would regress in the deprecated information given, particularly the "reason" section (this didn't seem to get caught in unit tests?)persistCheckedTypesin Frontend, which recreates the binding from scratch but only from type information.To me, it seems like the deprecated information on Bindings / Props is legacy and might be worthwhile to remove? Although we still need a way for the host to enforce deprecation for non-function members in props.
However, if you think it's better to take the binding / props approach, I can switch it around to that.
Fixes #2158