Skip to content

Regression in autocompletion on spread generic arguments #54572

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

Closed
dexx086 opened this issue Jun 8, 2023 · 1 comment Β· Fixed by #54588
Closed

Regression in autocompletion on spread generic arguments #54572

dexx086 opened this issue Jun 8, 2023 · 1 comment Β· Fixed by #54588
Labels
Domain: Completion Lists The issue relates to showing completion lists in an editor Help Wanted You can do this Possible Improvement The current behavior isn't wrong, but it's possible to see that it might be better in some cases
Milestone

Comments

@dexx086
Copy link

dexx086 commented Jun 8, 2023

Bug Report

πŸ”Ž Search Terms

autocomplete, regression

πŸ•— Version & Regression Information

  • This changed between versions 5.0.4 and 5.1.3

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

function fn<T extends ('value1' | 'value2' | 'value3')[]>(...values: T): T { return values; }

const value1 = fn('');
const value2 = fn('value1', '');

πŸ™ Actual behavior

It should autocomplete inside both '' (empty string) places with value1|value2|value3 possible values, however it shows incorrect (kind of randomly gathered) options. For eg.:

image

πŸ™‚ Expected behavior

It should show only value1 / value2 / value3 options (as it does correctly with 5.0.4 and before), like this:

image

This issue could be related to (#53555) and (#52726) but I think my case is more basic, and appeared only in the latest (5.1.3) version of TS. (couldn't test if versions between 5.1.0 and 5.1.3 were affected or not, I could test only 5.1.3).

@Andarist
Copy link
Contributor

Andarist commented Jun 9, 2023

Bisected this to: #52717 . Gonna look into fixing this soon

@RyanCavanaugh RyanCavanaugh added Help Wanted You can do this Possible Improvement The current behavior isn't wrong, but it's possible to see that it might be better in some cases labels Jun 12, 2023
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Jun 12, 2023
@RyanCavanaugh RyanCavanaugh added the Domain: Completion Lists The issue relates to showing completion lists in an editor label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: Completion Lists The issue relates to showing completion lists in an editor Help Wanted You can do this Possible Improvement The current behavior isn't wrong, but it's possible to see that it might be better in some cases
Projects
None yet
3 participants