Skip to content

prune the refactor not applicable reasons if there are too many#103203

Merged
mjbvz merged 2 commits intomicrosoft:masterfrom
PranavSenthilnathan:pranas/refactorreasonpruning
Aug 31, 2020
Merged

prune the refactor not applicable reasons if there are too many#103203
mjbvz merged 2 commits intomicrosoft:masterfrom
PranavSenthilnathan:pranas/refactorreasonpruning

Conversation

@PranavSenthilnathan
Copy link
Member

The TypeScript server sends back why a refactor is not applicable and vscode has started consuming it as well. At any given time most refactors are not applicable and there are a decent number of refactors, so the refactor list is long. This PR prunes it to the applicable refactors + the top 5 not applicable refactors (which are grayed out and serve to help discoverability). The refactor not applicable reason was discussed here (for more context): microsoft/TypeScript#35098

@PranavSenthilnathan
Copy link
Member Author

@mjbvz

@mjbvz mjbvz added this to the July 2020 milestone Jul 28, 2020
return false;
}

private appendInvalidActions(actions: vscode.CodeAction[]): vscode.CodeAction[] {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this we won't be shipping TS 4.0 for another iteration, I think we should keep this logic as it does not rely on the new TS API

See

for an example server version check

@joaomoreno joaomoreno modified the milestones: July 2020, August 2020 Aug 5, 2020
@mjbvz mjbvz force-pushed the pranas/refactorreasonpruning branch from cab32a2 to 3c4d81c Compare August 31, 2020 22:36
@mjbvz mjbvz merged commit fb80351 into microsoft:master Aug 31, 2020
@mjbvz
Copy link
Collaborator

mjbvz commented Aug 31, 2020

Added back the old logic for versions of TS < 4.0. Let me know if there are any problems with the changes

@github-actions github-actions bot locked and limited conversation to collaborators Oct 16, 2020
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.

3 participants