(
colours: Record<number, number>,
schemeName: string,
editorDecorations: monaco.editor.IEditorDecorationsCollection,
)
| 88 | ]; |
| 89 | |
| 90 | export function applyColours( |
| 91 | colours: Record<number, number>, |
| 92 | schemeName: string, |
| 93 | editorDecorations: monaco.editor.IEditorDecorationsCollection, |
| 94 | ): void { |
| 95 | const scheme = schemes.find(scheme => scheme.name === schemeName) ?? schemes[0]; |
| 96 | const newDecorations: monaco.editor.IModelDeltaDecoration[] = Object.entries(colours).map(([line, index]) => { |
| 97 | const realLineNumber = Number.parseInt(line, 10) + 1; |
| 98 | return { |
| 99 | range: new monaco.Range(realLineNumber, 1, realLineNumber, 1), |
| 100 | options: { |
| 101 | isWholeLine: true, |
| 102 | className: 'line-linkage ' + scheme.name + '-' + (index % scheme.count), |
| 103 | }, |
| 104 | }; |
| 105 | }); |
| 106 | |
| 107 | editorDecorations.set(newDecorations); |
| 108 | } |
no test coverage detected