dsherret / ts-type-info

TypeScript AST and code generator [Deprecated]
MIT License
94 stars 8 forks source link

Refresh function to update the definition from the underlying AST #213

Closed dsherret closed 7 years ago

dsherret commented 7 years ago

This would be something like this:

const result = TsTypeInfo.getInfoFromFiles(["V:\\TestFile.ts"], { includeTsNodes: true });
const file = result.getFile("TestFile.ts");

// do some changes with file.tsNode here

// now refresh the definition
file.refresh();
// or:
const newFile = file = file.refreshCopy();

// newFile and file would be updated to reflect changes made to tsNode

It would not be worth it to make the refresh() function also refresh all the children. It might be worth adding a deepRefresh function in the future.

dsherret commented 7 years ago

Not doing. Focusing dev effort on ts-simple-ast.