import { getNextKey } from "../util" ; import { File } from "./File" ; export function monacoSeverityToString ( severity ) { switch ( severity ) { case monaco . MarkerSeverity . Info : return "info" ; case monaco . MarkerSeverity . Warning : return "warning" ; case monaco . MarkerSeverity . Error : return "error" ; } } export class Problem { readonly key = String ( getNextKey ( ) ) ; constructor ( public file , public description , public severity , public marker ? ) { } static fromMarker ( file , marker ) { return new Problem ( file , `${ marker . message } (${ marker . startLineNumber }, ${ marker . startColumn })` , monacoSeverityToString ( marker . severity ) , marker ) ; } }