-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Retry string completions from the inferred type by default #53481
Conversation
@@ -439,7 +439,7 @@ function getStringLiteralCompletionEntries(sourceFile: SourceFile, node: StringL | |||
const literals = contextualTypes.types.filter(literal => !tracker.hasValue(literal.value)); | |||
return { kind: StringLiteralCompletionKind.Types, types: literals, isNewIdentifier: false }; | |||
default: | |||
return fromContextualType(); | |||
return fromContextualType() || fromContextualType(ContextFlags.None); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a more conservative approach would be to do this:
case SyntaxKind.ArrayLiteralExpression:
return fromContextualType() || fromContextualType(ContextFlags.None);
default:
return fromContextualType();
i went for a broad fix~ but perhaps some node types should not be subjects for those retries?
Is this something we need to be backporting? Per #53475 (comment) this is a 5.0 regression, so it's probably good to get in before we send it out? |
@typescript-bot user test tsserver |
Heya @DanielRosenwasser, I've started to run the perf test suite on this PR at ea75390. You can monitor the build here. Update: The results are in! |
Heya @DanielRosenwasser, I've started to run the diff-based user code test suite (tsserver) on this PR at ea75390. You can monitor the build here. Update: The results are in! |
Heya @DanielRosenwasser, I've started to run the diff-based top-repos suite (tsserver) on this PR at ea75390. You can monitor the build here. Update: The results are in! |
@DanielRosenwasser Here are the results of running the user test suite comparing Everything looks good! |
@DanielRosenwasser Here they are:
CompilerComparison Report - main..53481
System
Hosts
Scenarios
TSServerComparison Report - main..53481
System
Hosts
Scenarios
StartupComparison Report - main..53481
System
Hosts
Scenarios
Developer Information: |
@DanielRosenwasser Here are the results of running the top-repos suite comparing Everything looks good! |
@typescript-bot cherry-pick this to release-5.0 |
Heya @DanielRosenwasser, I've started to run the task to cherry-pick this into |
I'll tentatively cherry-pick. |
Hey @DanielRosenwasser, I've opened #53551 for you. |
Component commits: ea75390 Retry string completions from the inferred type by default
Thanks guys! |
…e-5.0 (#53551) Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
…to release-5.0 (microsoft#53551) Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
fixes #53475
I'm using the same strategy to retry those requests as the one used in https://github.com/microsoft/TypeScript/pull/52875/files
cc @andrewbranch