Skip to content
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

Fixed a regression with string completions not being available directly in arguments typed using rest parameter #54588

Merged

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Jun 9, 2023

fixes #54572 (a regression from #52717 )

cc @andrewbranch

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Jun 9, 2023
@@ -388,7 +388,7 @@ function getStringLiteralCompletionEntries(sourceFile: SourceFile, node: StringL
// Get string literal completions from specialized signatures of the target
// i.e. declare function f(a: 'A');
// f("/*completion position*/")
return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || fromContextualType();
return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || fromContextualType(ContextFlags.None);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

getStringLiteralCompletionsFromSignature is already using the "inference blocking strategy" so it doesn't make sense (at least usually) for the fallback request~ to use it as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is kinda using a simplified approach from the one that I was taking here. So that other PR is also fixing this as is this PR: #54121

Copy link
Member

@andrewbranch andrewbranch left a comment

Choose a reason for hiding this comment

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

@andrewbranch andrewbranch merged commit d95caa5 into microsoft:main Jun 12, 2023
@Andarist
Copy link
Contributor Author

@andrewbranch i wonder if there is a chance to cherry-pick this into 5.1

@andrewbranch
Copy link
Member

^ @DanielRosenwasser what do you think

@DanielRosenwasser
Copy link
Member

@typescript-bot cherry-pick this to release-5.1

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 13, 2023

Heya @DanielRosenwasser, I've started to run the task to cherry-pick this into release-5.1 on this PR at 8e1f8b6. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

Hey @DanielRosenwasser, I've opened #54635 for you.

typescript-bot pushed a commit to typescript-bot/TypeScript that referenced this pull request Jun 13, 2023
Component commits:
8e1f8b6 Fixed a regression with string completions not being available directly in arguments typed using rest parameter
@Andarist Andarist deleted the fix/string-literal-directly-in-rest branch June 13, 2023 17:09
DanielRosenwasser pushed a commit that referenced this pull request Jun 26, 2023
…e-5.1 (#54635)

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression in autocompletion on spread generic arguments
4 participants