import * as vscode from 'vscode' ; import { CustomCode } from './remotes/zsimulator/customcode' ; /**
 * A single that manges diagnostics. I.e. errors found in the
 * peripherals js code.
 */ export class DiagnosticsHandler { protected static diagnosticsCollection : vscode . DiagnosticCollection ; /**
     * Subscribes the diagnostics.
     */ public static Init ( context ) { this . diagnosticsCollection = vscode . languages . createDiagnosticCollection ( "DeZog" ) ; context . subscriptions . push ( this . diagnosticsCollection ) ; CustomCode . addDiagnosticsErrorFunc = this . add ; } /**
     * Clears all diagnostics messages.
     * E.g. called at start of unit tests or at start of a
     * debug session.
     */ public static clear ( ) { this . diagnosticsCollection . clear ( ) ; } param message param filepath param lien param column public static add ( message , filepath , line , column = 0 ) { const uri = vscode . Uri . file ( filepath ) ; const range = new vscode . Range ( line , column , line , column ) ; const diagnostic = new vscode . Diagnostic ( range , message , vscode . DiagnosticSeverity . Error ) ; this . diagnosticsCollection . set ( uri , [ diagnostic ] ) ; } }