mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
Fixed a regression with string completions not being available directly in arguments typed using rest parameter (#54588)
This commit is contained in:
parent
9d17b345b4
commit
d95caa51fc
@ -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("")`)
|
||||
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
// @strict: true
|
||||
////
|
||||
//// function fn<T extends ('value1' | 'value2' | 'value3')[]>(...values: T): T { return values; }
|
||||
////
|
||||
//// const value1 = fn('/*1*/');
|
||||
//// const value2 = fn('value1', '/*2*/');
|
||||
|
||||
verify.completions({ marker: ["1", "2"], includes: [`value1`, `value2`, `value3`] })
|
||||
Loading…
x
Reference in New Issue
Block a user