Skip to content

Instantly share code, notes, and snippets.

@johnnyhalife
Created October 26, 2022 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnnyhalife/414903e1b6e11b4561a7ed100e7f7670 to your computer and use it in GitHub Desktop.
Save johnnyhalife/414903e1b6e11b4561a7ed100e7f7670 to your computer and use it in GitHub Desktop.
private visitNode(node: Node): void {
if (isClassDeclaration(node)) {
console.log("Hi class:", node.name);
}
node.forEachChild(child => this.visitNode(child));
}
const program = createProgram(["file.ts"]);
const sourceFile =program.getSourceFile("file.ts");
visitNode(sourceFile);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment