From b823694a7e48a0983688b027d11df8f642d8c0a2 Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:20:24 +0100 Subject: [PATCH] fix: take complex/mapped typed into account during prop completions (#2563) #2549 --- .../src/plugins/typescript/ComponentInfoProvider.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/language-server/src/plugins/typescript/ComponentInfoProvider.ts b/packages/language-server/src/plugins/typescript/ComponentInfoProvider.ts index 64b94d50b..c85195ae9 100644 --- a/packages/language-server/src/plugins/typescript/ComponentInfoProvider.ts +++ b/packages/language-server/src/plugins/typescript/ComponentInfoProvider.ts @@ -76,7 +76,11 @@ export class JsOrTsComponentInfoProvider implements ComponentInfoProvider { .getProperties() .map((prop) => { // type would still be correct when there're multiple declarations - const declaration = prop.valueDeclaration ?? prop.declarations?.[0]; + const declaration = + prop.valueDeclaration ?? + prop.declarations?.[0] ?? + // very complex types are hidden on this thing for some reason + (prop as any)?.links?.mappedType?.declaration; if (!declaration) { return; }