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

Function getTypeOnlyPromotionFix

test/fixtures/snapshot/typescript.js:153581–153590  ·  view source on GitHub ↗
(sourceFile, symbolToken, symbolName, program)

Source from the content-addressed store, hash-verified

153579 return { fixes: fixes, symbolName: symbolName, errorIdentifierText: symbolToken.text };
153580 }
153581 function getTypeOnlyPromotionFix(sourceFile, symbolToken, symbolName, program) {
153582 var checker = program.getTypeChecker();
153583 var symbol = checker.resolveName(symbolName, symbolToken, 111551 /* SymbolFlags.Value */, /*excludeGlobals*/ true);
153584 if (!symbol)
153585 return undefined;
153586 var typeOnlyAliasDeclaration = checker.getTypeOnlyAliasDeclaration(symbol);
153587 if (!typeOnlyAliasDeclaration || ts.getSourceFileOfNode(typeOnlyAliasDeclaration) !== sourceFile)
153588 return undefined;
153589 return { kind: 4 /* ImportFixKind.PromoteTypeOnly */, typeOnlyAliasDeclaration: typeOnlyAliasDeclaration };
153590 }
153591 function getSymbolName(sourceFile, checker, symbolToken, compilerOptions) {
153592 var parent = symbolToken.parent;
153593 if ((ts.isJsxOpeningLikeElement(parent) || ts.isJsxClosingElement(parent)) && parent.tagName === symbolToken && ts.jsxModeNeedsExplicitImport(compilerOptions.jsx)) {

Callers 2

getFixesInfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected