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

Function getReferencesInContainerOrFiles

test/fixtures/snapshot/typescript.js:137650–137665  ·  view source on GitHub ↗
(symbol, state, search)

Source from the content-addressed store, hash-verified

137648 return result;
137649 }
137650 function getReferencesInContainerOrFiles(symbol, state, search) {
137651 // Try to get the smallest valid scope that we can limit our search to;
137652 // otherwise we'll need to search globally (i.e. include each file).
137653 var scope = getSymbolScope(symbol);
137654 if (scope) {
137655 getReferencesInContainer(scope, scope.getSourceFile(), search, state, /*addReferencesHere*/ !(ts.isSourceFile(scope) && !ts.contains(state.sourceFiles, scope)));
137656 }
137657 else {
137658 // Global search
137659 for (var _i = 0, _a = state.sourceFiles; _i < _a.length; _i++) {
137660 var sourceFile = _a[_i];
137661 state.cancellationToken.throwIfCancellationRequested();
137662 searchForName(sourceFile, search, state);
137663 }
137664 }
137665 }
137666 function getSpecialSearchKind(node) {
137667 switch (node.kind) {
137668 case 171 /* SyntaxKind.Constructor */:

Calls 4

getSymbolScopeFunction · 0.85
getReferencesInContainerFunction · 0.85
searchForNameFunction · 0.85
containsMethod · 0.45

Tested by

no test coverage detected