| 138002 | } |
| 138003 | Core.eachSymbolReferenceInFile = eachSymbolReferenceInFile; |
| 138004 | function getTopMostDeclarationNamesInFile(declarationName, sourceFile) { |
| 138005 | var candidates = ts.filter(getPossibleSymbolReferenceNodes(sourceFile, declarationName), function (name) { return !!ts.getDeclarationFromName(name); }); |
| 138006 | return candidates.reduce(function (topMost, decl) { |
| 138007 | var depth = getDepth(decl); |
| 138008 | if (!ts.some(topMost.declarationNames) || depth === topMost.depth) { |
| 138009 | topMost.declarationNames.push(decl); |
| 138010 | topMost.depth = depth; |
| 138011 | } |
| 138012 | else if (depth < topMost.depth) { |
| 138013 | topMost.declarationNames = [decl]; |
| 138014 | topMost.depth = depth; |
| 138015 | } |
| 138016 | return topMost; |
| 138017 | }, { depth: Infinity, declarationNames: [] }).declarationNames; |
| 138018 | function getDepth(declaration) { |
| 138019 | var depth = 0; |
| 138020 | while (declaration) { |
| 138021 | declaration = ts.getContainerNode(declaration); |
| 138022 | depth++; |
| 138023 | } |
| 138024 | return depth; |
| 138025 | } |
| 138026 | } |
| 138027 | Core.getTopMostDeclarationNamesInFile = getTopMostDeclarationNamesInFile; |
| 138028 | function someSignatureUsage(signature, sourceFiles, checker, cb) { |
| 138029 | if (!signature.name || !ts.isIdentifier(signature.name)) |