()
| 87244 | } |
| 87245 | } |
| 87246 | function createResolver() { |
| 87247 | // this variable and functions that use it are deliberately moved here from the outer scope |
| 87248 | // to avoid scope pollution |
| 87249 | var resolvedTypeReferenceDirectives = host.getResolvedTypeReferenceDirectives(); |
| 87250 | var fileToDirective; |
| 87251 | if (resolvedTypeReferenceDirectives) { |
| 87252 | // populate reverse mapping: file path -> type reference directive that was resolved to this file |
| 87253 | fileToDirective = new ts.Map(); |
| 87254 | resolvedTypeReferenceDirectives.forEach(function (resolvedDirective, key, mode) { |
| 87255 | if (!resolvedDirective || !resolvedDirective.resolvedFileName) { |
| 87256 | return; |
| 87257 | } |
| 87258 | var file = host.getSourceFile(resolvedDirective.resolvedFileName); |
| 87259 | if (file) { |
| 87260 | // Add the transitive closure of path references loaded by this file (as long as they are not) |
| 87261 | // part of an existing type reference. |
| 87262 | addReferencedFilesToTypeDirective(file, key, mode); |
| 87263 | } |
| 87264 | }); |
| 87265 | } |
| 87266 | return { |
| 87267 | getReferencedExportContainer: getReferencedExportContainer, |
| 87268 | getReferencedImportDeclaration: getReferencedImportDeclaration, |
| 87269 | getReferencedDeclarationWithCollidingName: getReferencedDeclarationWithCollidingName, |
| 87270 | isDeclarationWithCollidingName: isDeclarationWithCollidingName, |
| 87271 | isValueAliasDeclaration: function (nodeIn) { |
| 87272 | var node = ts.getParseTreeNode(nodeIn); |
| 87273 | // Synthesized nodes are always treated like values. |
| 87274 | return node ? isValueAliasDeclaration(node) : true; |
| 87275 | }, |
| 87276 | hasGlobalName: hasGlobalName, |
| 87277 | isReferencedAliasDeclaration: function (nodeIn, checkChildren) { |
| 87278 | var node = ts.getParseTreeNode(nodeIn); |
| 87279 | // Synthesized nodes are always treated as referenced. |
| 87280 | return node ? isReferencedAliasDeclaration(node, checkChildren) : true; |
| 87281 | }, |
| 87282 | getNodeCheckFlags: function (nodeIn) { |
| 87283 | var node = ts.getParseTreeNode(nodeIn); |
| 87284 | return node ? getNodeCheckFlags(node) : 0; |
| 87285 | }, |
| 87286 | isTopLevelValueImportEqualsWithEntityName: isTopLevelValueImportEqualsWithEntityName, |
| 87287 | isDeclarationVisible: isDeclarationVisible, |
| 87288 | isImplementationOfOverload: isImplementationOfOverload, |
| 87289 | isRequiredInitializedParameter: isRequiredInitializedParameter, |
| 87290 | isOptionalUninitializedParameterProperty: isOptionalUninitializedParameterProperty, |
| 87291 | isExpandoFunctionDeclaration: isExpandoFunctionDeclaration, |
| 87292 | getPropertiesOfContainerFunction: getPropertiesOfContainerFunction, |
| 87293 | createTypeOfDeclaration: createTypeOfDeclaration, |
| 87294 | createReturnTypeOfSignatureDeclaration: createReturnTypeOfSignatureDeclaration, |
| 87295 | createTypeOfExpression: createTypeOfExpression, |
| 87296 | createLiteralConstValue: createLiteralConstValue, |
| 87297 | isSymbolAccessible: isSymbolAccessible, |
| 87298 | isEntityNameVisible: isEntityNameVisible, |
| 87299 | getConstantValue: function (nodeIn) { |
| 87300 | var node = ts.getParseTreeNode(nodeIn, canHaveConstantValue); |
| 87301 | return node ? getConstantValue(node) : undefined; |
| 87302 | }, |
| 87303 | collectLinkedAliases: collectLinkedAliases, |
no test coverage detected
searching dependent graphs…