Skip to content

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

Merged
jrieken merged 2 commits intomicrosoft:mainfrom
nrayburn-tech:fix-77239
May 21, 2021
Merged

Add showDeprecated option to suggest, filters out deprecated options#123351
jrieken merged 2 commits intomicrosoft:mainfrom
nrayburn-tech:fix-77239

Conversation

@nrayburn-tech
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
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