import { TextEditor } from 'vscode' ; import { IDecoration } from './util/color-util' ; class EditorManager { static param { TextEditor } editor param { Map < number , IDecoration [ ] > } decorations param { number [ ] } skipLines returns memberof public static decorate ( editor , decorations , skipLines ) { const it = decorations . entries ( ) ; let tmp = it . next ( ) ; while ( ! tmp . done ) { const line = tmp . value [ 0 ] ; const deco = tmp . value [ 1 ] ; if ( skipLines . indexOf ( line ) === - 1 ) { this . decorateOneLine ( editor , deco , line ) ; } tmp = it . next ( ) ; } return ; } static param { TextEditor } editor param { IDecoration [ ] } decorations param { number } line memberof public static decorateOneLine ( editor , decorations , line ) { decorations . forEach ( ( decoration ) => { if ( decoration . shouldGenerateDecoration ( ) === true ) { editor . setDecorations ( decoration . decoration , [ decoration . generateRange ( line ) ] ) ; } } ) ; } } export default EditorManager ;