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

Function createTypeChecker

test/fixtures/snapshot/typescript.js:48232–89260  ·  view source on GitHub ↗
(host)

Source from the content-addressed store, hash-verified

48230 }
48231 ts.isInstantiatedModule = isInstantiatedModule;
48232 function createTypeChecker(host) {
48233 var getPackagesMap = ts.memoize(function () {
48234 // A package name maps to true when we detect it has .d.ts files.
48235 // This is useful as an approximation of whether a package bundles its own types.
48236 // Note: we only look at files already found by module resolution,
48237 // so there may be files we did not consider.
48238 var map = new ts.Map();
48239 host.getSourceFiles().forEach(function (sf) {
48240 if (!sf.resolvedModules)
48241 return;
48242 sf.resolvedModules.forEach(function (r) {
48243 if (r && r.packageId)
48244 map.set(r.packageId.name, r.extension === ".d.ts" /* Extension.Dts */ || !!map.get(r.packageId.name));
48245 });
48246 });
48247 return map;
48248 });
48249 var deferredDiagnosticsCallbacks = [];
48250 var addLazyDiagnostic = function (arg) {
48251 deferredDiagnosticsCallbacks.push(arg);
48252 };
48253 // Cancellation that controls whether or not we can cancel in the middle of type checking.
48254 // In general cancelling is *not* safe for the type checker. We might be in the middle of
48255 // computing something, and we will leave our internals in an inconsistent state. Callers
48256 // who set the cancellation token should catch if a cancellation exception occurs, and
48257 // should throw away and create a new TypeChecker.
48258 //
48259 // Currently we only support setting the cancellation token when getting diagnostics. This
48260 // is because diagnostics can be quite expensive, and we want to allow hosts to bail out if
48261 // they no longer need the information (for example, if the user started editing again).
48262 var cancellationToken;
48263 var requestedExternalEmitHelpers;
48264 var externalHelpersModule;
48265 var Symbol = ts.objectAllocator.getSymbolConstructor();
48266 var Type = ts.objectAllocator.getTypeConstructor();
48267 var Signature = ts.objectAllocator.getSignatureConstructor();
48268 var typeCount = 0;
48269 var symbolCount = 0;
48270 var enumCount = 0;
48271 var totalInstantiationCount = 0;
48272 var instantiationCount = 0;
48273 var instantiationDepth = 0;
48274 var inlineLevel = 0;
48275 var currentNode;
48276 var varianceTypeParameter;
48277 var emptySymbols = ts.createSymbolTable();
48278 var arrayVariances = [1 /* VarianceFlags.Covariant */];
48279 var compilerOptions = host.getCompilerOptions();
48280 var languageVersion = ts.getEmitScriptTarget(compilerOptions);
48281 var moduleKind = ts.getEmitModuleKind(compilerOptions);
48282 var useDefineForClassFields = ts.getUseDefineForClassFields(compilerOptions);
48283 var allowSyntheticDefaultImports = ts.getAllowSyntheticDefaultImports(compilerOptions);
48284 var strictNullChecks = ts.getStrictOptionValue(compilerOptions, "strictNullChecks");
48285 var strictFunctionTypes = ts.getStrictOptionValue(compilerOptions, "strictFunctionTypes");
48286 var strictBindCallApply = ts.getStrictOptionValue(compilerOptions, "strictBindCallApply");
48287 var strictPropertyInitialization = ts.getStrictOptionValue(compilerOptions, "strictPropertyInitialization");
48288 var noImplicitAny = ts.getStrictOptionValue(compilerOptions, "noImplicitAny");
48289 var noImplicitThis = ts.getStrictOptionValue(compilerOptions, "noImplicitThis");

Callers

nothing calls this directly

Calls 15

createResolverFunction · 0.85
createNodeBuilderFunction · 0.85
createSymbolFunction · 0.85
getPropertyOfTypeFunction · 0.85
getTypeOfPropertyOfTypeFunction · 0.85
getIndexInfoOfTypeFunction · 0.85
getIndexTypeOfTypeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…