MCPcopy Create free account
hub / github.com/nodejs/node / convertClassificationsToSpans

Function convertClassificationsToSpans

test/fixtures/snapshot/typescript.js:130489–130500  ·  view source on GitHub ↗
(classifications)

Source from the content-addressed store, hash-verified

130487 }
130488 }
130489 function convertClassificationsToSpans(classifications) {
130490 ts.Debug.assert(classifications.spans.length % 3 === 0);
130491 var dense = classifications.spans;
130492 var result = [];
130493 for (var i = 0; i < dense.length; i += 3) {
130494 result.push({
130495 textSpan: ts.createTextSpan(dense[i], dense[i + 1]),
130496 classificationType: getClassificationTypeName(dense[i + 2])
130497 });
130498 }
130499 return result;
130500 }
130501 /* @internal */
130502 function getSyntacticClassifications(cancellationToken, sourceFile, span) {
130503 return convertClassificationsToSpans(getEncodedSyntacticClassifications(cancellationToken, sourceFile, span));

Callers 2

Calls 3

assertMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected