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

Function addImportFromDiagnostic

test/fixtures/snapshot/typescript.js:152911–152916  ·  view source on GitHub ↗
(diagnostic, context)

Source from the content-addressed store, hash-verified

152909 var newImports = new ts.Map();
152910 return { addImportFromDiagnostic: addImportFromDiagnostic, addImportFromExportedSymbol: addImportFromExportedSymbol, writeFixes: writeFixes, hasFixes: hasFixes };
152911 function addImportFromDiagnostic(diagnostic, context) {
152912 var info = getFixesInfo(context, diagnostic.code, diagnostic.start, useAutoImportProvider);
152913 if (!info || !info.fixes.length)
152914 return;
152915 addImport(info);
152916 }
152917 function addImportFromExportedSymbol(exportedSymbol, isValidTypeOnlyUseSite) {
152918 var moduleSymbol = ts.Debug.checkDefined(exportedSymbol.parent);
152919 var symbolName = ts.getNameForExportedSymbol(exportedSymbol, ts.getEmitScriptTarget(compilerOptions));

Callers

nothing calls this directly

Calls 2

getFixesInfoFunction · 0.85
addImportFunction · 0.85

Tested by

no test coverage detected