diff --git a/packages/language-core/src/generators/script.ts b/packages/language-core/src/generators/script.ts index d3bc08318d..d12a704b5e 100644 --- a/packages/language-core/src/generators/script.ts +++ b/packages/language-core/src/generators/script.ts @@ -118,6 +118,7 @@ export function generate( default: D[K] }> : P[K] };\n`); + codes.push(`type __VLS_Prettify = { [K in keyof T]: T[K]; } & {};\n`); } if (usedHelperTypes.WithTemplateSlots) { codes.push( diff --git a/packages/tsc/tests/__snapshots__/dts.spec.ts.snap b/packages/tsc/tests/__snapshots__/dts.spec.ts.snap index 3b34d22a6f..d425810cef 100644 --- a/packages/tsc/tests/__snapshots__/dts.spec.ts.snap +++ b/packages/tsc/tests/__snapshots__/dts.spec.ts.snap @@ -196,6 +196,9 @@ type __VLS_WithDefaults = { default: D[K]; }> : P[K]; }; +type __VLS_Prettify = { + [K in keyof T]: T[K]; +} & {}; " `;