Skip to content

Commit b823694

Browse files
authored
fix: take complex/mapped typed into account during prop completions (#2563)
#2549
1 parent 776125b commit b823694

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/language-server/src/plugins/typescript/ComponentInfoProvider.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ export class JsOrTsComponentInfoProvider implements ComponentInfoProvider {
7676
.getProperties()
7777
.map((prop) => {
7878
// type would still be correct when there're multiple declarations
79-
const declaration = prop.valueDeclaration ?? prop.declarations?.[0];
79+
const declaration =
80+
prop.valueDeclaration ??
81+
prop.declarations?.[0] ??
82+
// very complex types are hidden on this thing for some reason
83+
(prop as any)?.links?.mappedType?.declaration;
8084
if (!declaration) {
8185
return;
8286
}

0 commit comments

Comments
 (0)