Skip to content

Add showDeprecated option to suggest, filters out deprecated options #123351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 21, 2021
Merged

Add showDeprecated option to suggest, filters out deprecated options #123351

merged 2 commits into from
May 21, 2021

Conversation

nrayburn-tech
Copy link
Contributor

Adds an option to showDeprecated in the suggest list. When false, deprecated items are not shown. Defaults to true, same as old behavior.

Changes were mostly done by following the showConstructors option.

Example
recording

This PR fixes #77239.

@nrayburn-tech
Copy link
Contributor Author

I wasn't sure if suggestOptions.showDeprecated should be added here or not.

if (!suggestOptions.showFields) { result.add(CompletionItemKind.Field); }

Deprecated also isn't in CompletionItemKind, and would have to be added. Also wasn't sure about that.

@jrieken jrieken added this to the May 2021 milestone May 10, 2021
@jrieken
Copy link
Member

jrieken commented May 18, 2021

I wasn't sure if suggestOptions.showDeprecated should be added here or not.

That would be the better place because filtering for deprecated needs to happen only once (not repeatedly as the user types). Tho, I would not add this as CompletionItemKind but as separate option to CompletionOptions.

@nrayburn-tech
Copy link
Contributor Author

@jrieken I believe the new changes are what you are asking for.

Copy link
Member

@jrieken jrieken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good

@jrieken jrieken merged commit d65dace into microsoft:main May 21, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to prevent deprecated things from showing up in intellisense suggestions
3 participants