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

Function tryReplaceImportTypeNodeWithAutoImport

test/fixtures/snapshot/typescript.js:156793–156800  ·  view source on GitHub ↗
(typeNode, declaration, sourceFile, changes, importAdder, scriptTarget)

Source from the content-addressed store, hash-verified

156791 }
156792 }
156793 function tryReplaceImportTypeNodeWithAutoImport(typeNode, declaration, sourceFile, changes, importAdder, scriptTarget) {
156794 var importableReference = codefix.tryGetAutoImportableReferenceFromTypeNode(typeNode, scriptTarget);
156795 if (importableReference && changes.tryInsertTypeAnnotation(sourceFile, declaration, importableReference.typeNode)) {
156796 ts.forEach(importableReference.symbols, function (s) { return importAdder.addImportFromExportedSymbol(s, /*usageIsTypeOnly*/ true); });
156797 return true;
156798 }
156799 return false;
156800 }
156801 function annotateJSDocParameters(changes, sourceFile, parameterInferences, program, host) {
156802 var signature = parameterInferences.length && parameterInferences[0].declaration.parent;
156803 if (!signature) {

Callers 1

annotateFunction · 0.85

Calls 1

forEachMethod · 0.65

Tested by

no test coverage detected