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

Function getPromoteTypeOnlyCompletionAction

test/fixtures/snapshot/typescript.js:153114–153120  ·  view source on GitHub ↗
(sourceFile, symbolToken, program, host, formatContext, preferences)

Source from the content-addressed store, hash-verified

153112 }
153113 codefix.getImportCompletionAction = getImportCompletionAction;
153114 function getPromoteTypeOnlyCompletionAction(sourceFile, symbolToken, program, host, formatContext, preferences) {
153115 var compilerOptions = program.getCompilerOptions();
153116 var symbolName = getSymbolName(sourceFile, program.getTypeChecker(), symbolToken, compilerOptions);
153117 var fix = getTypeOnlyPromotionFix(sourceFile, symbolToken, symbolName, program);
153118 var includeSymbolNameInDescription = symbolName !== symbolToken.text;
153119 return fix && codeFixActionToCodeAction(codeActionForFix({ host: host, formatContext: formatContext, preferences: preferences }, sourceFile, symbolName, fix, includeSymbolNameInDescription, 1 /* QuotePreference.Double */, compilerOptions));
153120 }
153121 codefix.getPromoteTypeOnlyCompletionAction = getPromoteTypeOnlyCompletionAction;
153122 function getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, useNamespaceInfo, isValidTypeOnlyUseSite, useRequire, host, preferences) {
153123 ts.Debug.assert(exportInfos.some(function (info) { return info.moduleSymbol === moduleSymbol || info.symbol.parent === moduleSymbol; }), "Some exportInfo should match the specified moduleSymbol");

Callers

nothing calls this directly

Calls 4

getSymbolNameFunction · 0.85
getTypeOnlyPromotionFixFunction · 0.85
codeActionForFixFunction · 0.85

Tested by

no test coverage detected