import * as babel from "@babel/code-frame" ; import * as fs from "fs" ; import * as tr from "text-runner-core" ; type PrintFunc = ( arg : string ) => void | boolean ; export function printCodeFrame ( output , location ) { if ( ! location ) { return ; } const fileContent = fs . readFileSync ( location . absoluteFilePath ( ) . platformified ( ) , "utf8" ) ; output ( babel . codeFrameColumns ( fileContent , { start : { line : location . line } } , { forceColor : true } ) ) ; }