( type: ts.NodeWithTypeArguments, resolvedSymbol: ResolvedSymbol, references: AST.TypeReferences, )
| 222 | } |
| 223 | |
| 224 | function resolveTypeReference( |
| 225 | type: ts.NodeWithTypeArguments, |
| 226 | resolvedSymbol: ResolvedSymbol, |
| 227 | references: AST.TypeReferences, |
| 228 | ): number { |
| 229 | if (!resolvedSymbol.sourceFile) { |
| 230 | throw new Error(`No declarations for resolve symbol ${getNodeDebugDescription(type)}`); |
| 231 | } |
| 232 | |
| 233 | const symbolName = resolvedSymbol.name; |
| 234 | const sourceFile = resolvedSymbol.sourceFile; |
| 235 | const sourceFileLocation = sourceFile.fileName; |
| 236 | |
| 237 | const typeReferences = references.references; |
| 238 | |
| 239 | for (let i = 0; i < typeReferences.length; i++) { |
| 240 | const existingReference = typeReferences[i]; |
| 241 | if (existingReference.name === symbolName && existingReference.fileName === sourceFileLocation) { |
| 242 | return i; |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | const index = typeReferences.length; |
| 247 | typeReferences.push({ name: symbolName, fileName: sourceFileLocation }); |
| 248 | |
| 249 | return index; |
| 250 | } |
| 251 | |
| 252 | function parseTypeFromSymbolGroup( |
| 253 | type: ts.NodeWithTypeArguments, |
no test coverage detected