MCPcopy Index your code
hub / github.com/python/cpython / highlightLine

Method highlightLine

Doc/_static/profiling-sampling-visualization.js:293–315  ·  view source on GitHub ↗
(lineNumber)

Source from the content-addressed store, hash-verified

291 }
292
293 highlightLine(lineNumber) {
294 if (this.currentLine === lineNumber) return;
295
296 if (this.currentLine !== null) {
297 const prevLine = this.codeContainer.querySelector(
298 `[data-line="${this.currentLine}"]`,
299 );
300 if (prevLine) prevLine.classList.remove("highlighted");
301 }
302
303 if (lineNumber === null || lineNumber === undefined) {
304 this.currentLine = null;
305 return;
306 }
307
308 this.currentLine = lineNumber;
309 const newLine = this.codeContainer.querySelector(
310 `[data-line="${lineNumber}"]`,
311 );
312 if (newLine) {
313 newLine.classList.add("highlighted");
314 }
315 }
316
317 reset() {
318 this.highlightLine(null);

Callers 3

resetMethod · 0.95
_processEventMethod · 0.80
_rebuildStateMethod · 0.80

Calls 2

removeMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected