Make a general helper function on the AST context to retrieve a type by identifier in the fashion needed by data formatters