import { Code } from './code' ; import { QuickAccess } from './quickaccess' ; export const enum ProblemSeverity { WARNING = 0 , ERROR = 1 } export class Problems { static PROBLEMS_VIEW_SELECTOR = '.panel .markers-panel' ; constructor ( private code , private quickAccess ) { } async showProblemsView ( ) { await this . quickAccess . runCommand ( 'workbench.panel.markers.view.focus' ) ; await this . waitForProblemsView ( ) ; } async hideProblemsView ( ) { await this . quickAccess . runCommand ( 'workbench.actions.view.problems' ) ; await this . code . waitForElement ( Problems . PROBLEMS_VIEW_SELECTOR , el => ! el ) ; } async waitForProblemsView ( ) { await this . code . waitForElement ( Problems . PROBLEMS_VIEW_SELECTOR ) ; } static getSelectorInProblemsView ( problemType ) { let selector = problemType === ProblemSeverity . WARNING ? 'codicon-warning' : 'codicon-error' ; return `div[id="workbench.panel.markers"] .monaco-tl-contents .marker-icon.${ selector }` ; } static getSelectorInEditor ( problemType ) { let selector = problemType === ProblemSeverity . WARNING ? 'squiggly-warning' : 'squiggly-error' ; return `.view-overlays .cdr.${ selector }` ; } }