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

Method _renderSource

Doc/_static/profiling-sampling-visualization.js:252–273  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

250 }
251
252 _renderSource() {
253 const lines = this.source.split("\n");
254
255 lines.forEach((line, index) => {
256 const lineNumber = index + 1;
257 const lineDiv = document.createElement("div");
258 lineDiv.className = "line";
259 lineDiv.dataset.line = lineNumber;
260
261 const lineNumSpan = document.createElement("span");
262 lineNumSpan.className = "line-number";
263 lineNumSpan.textContent = lineNumber;
264 lineDiv.appendChild(lineNumSpan);
265
266 const codeSpan = document.createElement("span");
267 codeSpan.className = "line-content";
268 codeSpan.innerHTML = this._highlightSyntax(line);
269 lineDiv.appendChild(codeSpan);
270
271 this.codeContainer.appendChild(lineDiv);
272 });
273 }
274
275 _highlightSyntax(line) {
276 return line

Callers 2

constructorMethod · 0.95
updateSourceMethod · 0.95

Calls 4

_highlightSyntaxMethod · 0.95
createElementMethod · 0.80
splitMethod · 0.45
appendChildMethod · 0.45

Tested by

no test coverage detected