MCPcopy
hub / github.com/compiler-explorer/compiler-explorer / applyColours

Function applyColours

static/colour.ts:90–108  ·  view source on GitHub ↗
(
    colours: Record<number, number>,
    schemeName: string,
    editorDecorations: monaco.editor.IEditorDecorationsCollection,
)

Source from the content-addressed store, hash-verified

88];
89
90export 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}

Callers 1

tryApplyIrColoursMethod · 0.85

Calls 2

findMethod · 0.80
setMethod · 0.65

Tested by

no test coverage detected