import { window } from 'vscode' ; import { telemetry } from '../telemetry' ; export function parseJson ( jsonString ) { let jsonData ; try { jsonData = JSON . parse ( jsonString . trim ( ) ) ; } catch ( e ) { window . showErrorMessage ( `JSON.parse() failed ${ e }` ) ; telemetry . sendError ( 'CAUGHT_ERROR' , new Error ( 'parseJson() failed' ) ) ; return ; } return jsonData ; }