import { Node , SourceFile , NodeFlags } from 'typescript' ; export function deSynthesized ( node , sourceFile ) { node . parent = sourceFile ; node . flags &= ~ NodeFlags . Synthesized ; return node ; } export function setParentContext < T > ( node , parent , cb ) { const savedParent = node . parent ; node . parent = parent ; const result = cb ( ) ; node . parent = savedParent ; return result ; }