Correct way of getting type for a variable declaration in a typescript AST?
问题 Took a look at the declarationEmitter and for variable declarations, it has the function #emitVariableDeclaration which eventually calls #writeTypeOfDeclaration . This code does what is says---it takes a variable declaration and prints the variable and its type---this is exactly what I want to do. The problem is that when I replicate this code, the VariableDeclaration node has no symbol property...and thus, the type is always "any". Is there a missing step to initialize "symbols"? //sample