Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor (decorations, buffer, random) {
this.buffer = buffer
this.random = random
this.nextMarkerId = MAX_BUILT_IN_SCOPE_ID + 1
this.markerIndex = new MarkerIndex()
this.classNamesByScopeId = new Map()
this.emitter = new Emitter()
this.invalidatedRanges = []
if (this.buffer) {
this.buffer.onDidChange(() => {
for (const invalidatedRange of this.invalidatedRanges) {
this.emitHighlightingChangeEvent(invalidatedRange)
}
this.invalidatedRanges = []
})
}
for (let value of decorations) {
const className = value[0]
const [rangeStart, rangeEnd] = Array.from(value[1])