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

This commit is contained in:
Mateusz Burzyński
2023-06-13 00:16:08 +02:00
committed by GitHub
parent 9d17b345b4
commit d95caa51fc
2 changed files with 10 additions and 1 deletions

View File

@@ -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);
}
// falls through (is `require("")` or `require(""` or `import("")`)