MCPcopy Index your code
hub / github.com/nodejs/node / getSemanticTokens

Function getSemanticTokens

test/fixtures/snapshot/typescript.js:131005–131014  ·  view source on GitHub ↗
(program, sourceFile, span, cancellationToken)

Source from the content-addressed store, hash-verified

131003 }
131004 v2020.getEncodedSemanticClassifications = getEncodedSemanticClassifications;
131005 function getSemanticTokens(program, sourceFile, span, cancellationToken) {
131006 var resultTokens = [];
131007 var collector = function (node, typeIdx, modifierSet) {
131008 resultTokens.push(node.getStart(sourceFile), node.getWidth(sourceFile), ((typeIdx + 1) << 8 /* TokenEncodingConsts.typeOffset */) + modifierSet);
131009 };
131010 if (program && sourceFile) {
131011 collectTokens(program, sourceFile, span, collector, cancellationToken);
131012 }
131013 return resultTokens;
131014 }
131015 function collectTokens(program, sourceFile, span, collector, cancellationToken) {
131016 var typeChecker = program.getTypeChecker();
131017 var inJSXElement = false;

Callers 1

Calls 1

collectTokensFunction · 0.85

Tested by

no test coverage detected