Description
🔎 Search Terms
"autocomplete", "suggestions", "intellisense", "object type", "type literal", "object property", "property value", "type argument", "type parameter", "type parameter binding", "generic type"
🕗 Version & Regression Information
- This changed between versions 5.9.3 and v6.0.0-dev.20260204
(It appears to be fixed in v6.0.0-dev.20260204, but I haven't found an issue for this so I'm opening this for reference)
⏯ Playground Link
💻 Code
type TransformResources = { 'AWS::Serverless-2016-10-31': {} }
type TransformName = keyof TransformResources
export type CloudFormationTemplate<
Options extends { Transform?: TransformName }
> = {
Transform?: Options['Transform']
}
type X = CloudFormationTemplate<{
Transform: '' // trigger suggest inside this string
}>🙁 Actual behavior
No autocomplete suggestions for the Transform string value
🙂 Expected behavior
Autocomplete suggests 'AWS::Serverless-2016-10-31'
Additional information about the issue
I want to use <Options extends { Transform?: TransformName }> instead of <Transform extends TransformName | undefined = undefined> for this because I might want to add other options in the future and type parameter order would become an issue. Hopefully TypeScript is increasing support for this kind of pattern because ordered type parameters can really be a pain.
I tried things like making the property required, adding other required properties, etc but the behavior was the same.
A weird, unsatisfying workaround for this is a Suggest utility type:
type Suggest<A, B extends A> = B
type X = CloudFormationTemplate<{Transform: Suggest<TransformName, ''>}> // suggestions work inside this string literal
Activity
mkantor commentedon Feb 7, 2026
#62170 was the pull request which made this work.
RyanCavanaugh commentedon Feb 10, 2026
🤖 Thank you for your issue! I've done some analysis to help get you started. This response is automatically generated; feel free to 👍 or 👎 this comment according to its usefulness.
Similar Issues
Here are the most similar issues I found
If your issue is a duplicate of one of these, feel free to close this issue. Otherwise, no action is needed.