Skip to content

Commit

Permalink
fix(language-service): use empty statement as parent of type node (#3…
Browse files Browse the repository at this point in the history
…6989)

In TypeScript 3.9, type nodes need to exist in the context of a statement.
This commit ensures that the synthetic type node has such a parent.

PR Close #36989
  • Loading branch information
Keen Yee Liau authored and kara committed May 14, 2020
1 parent c42f35e commit a32cbed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/language-service/src/typescript_symbols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ function getTsTypeFromBuiltinType(builtinType: BuiltinType, ctx: TypeContext): t
`Internal error, unhandled literal kind ${builtinType}:${BuiltinType[builtinType]}`);
}
const node = ts.createNode(syntaxKind);
node.parent = ctx.node;
node.parent = ts.createEmptyStatement();
return ctx.checker.getTypeAtLocation(node);
}

Expand Down

0 comments on commit a32cbed

Please sign in to comment.