Skip to content

Commit fd93699

Browse files
committed
Fixing formatting
1 parent ea3752a commit fd93699

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

src/services/findAllReferences.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,9 @@ namespace ts.FindAllReferences {
359359
}
360360

361361
/** Search within node "container" for references for a search value, where the search value is defined as a
362-
* tuple of(searchSymbol, searchText, searchLocation, and searchMeaning).
363-
* searchLocation: a node where the search value
364-
*/
362+
* tuple of(searchSymbol, searchText, searchLocation, and searchMeaning).
363+
* searchLocation: a node where the search value
364+
*/
365365
function getReferencesInNode(container: Node,
366366
searchSymbol: Symbol,
367367
searchText: string,
@@ -444,10 +444,10 @@ namespace ts.FindAllReferences {
444444
return;
445445

446446
/* If we are just looking for implementations and this is a property access expression, we need to get the
447-
* symbol of the local type of the symbol the property is being accessed on. This is because our search
448-
* symbol may have a different parent symbol if the local type's symbol does not declare the property
449-
* being accessed (i.e. it is declared in some parent class or interface)
450-
*/
447+
* symbol of the local type of the symbol the property is being accessed on. This is because our search
448+
* symbol may have a different parent symbol if the local type's symbol does not declare the property
449+
* being accessed (i.e. it is declared in some parent class or interface)
450+
*/
451451
function getParentSymbolsOfPropertyAccess(): Symbol[] | undefined {
452452
if (implementations) {
453453
const propertyAccessExpression = getPropertyAccessExpressionFromRightHandSide(searchLocation);
@@ -722,7 +722,7 @@ namespace ts.FindAllReferences {
722722
// Set the key so that we don't infinitely recurse
723723
cachedResults[key] = false;
724724

725-
const inherits = forEach(symbol.getDeclarations(), (declaration) => {
725+
const inherits = forEach(symbol.getDeclarations(), declaration => {
726726
if (isClassLike(declaration)) {
727727
if (parentIsInterface) {
728728
const interfaceReferences = getClassImplementsHeritageClauseElements(declaration);

src/services/goToImplementation.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
/* @internal */
22
namespace ts.GoToImplementation {
3-
export function getImplementationAtPosition(typeChecker: TypeChecker, cancellationToken: CancellationToken, sourceFiles: SourceFile[], node: Node): ImplementationLocation[] {
4-
// If invoked directly on a shorthand property assignment, then return
5-
// the declaration of the symbol being assigned (not the symbol being assigned to).
6-
if (node.parent.kind === SyntaxKind.ShorthandPropertyAssignment) {
7-
const result: ReferenceEntry[] = [];
8-
FindAllReferences.getReferenceEntriesForShorthandPropertyAssignment(node, typeChecker, result);
9-
return result.length > 0 ? result : undefined;
10-
}
11-
else if (node.kind === SyntaxKind.SuperKeyword || isSuperProperty(node.parent)) {
12-
// References to and accesses on the super keyword only have one possible implementation, so no
13-
// need to "Find all References"
14-
const symbol = typeChecker.getSymbolAtLocation(node);
15-
return symbol.valueDeclaration && [FindAllReferences.getReferenceEntryFromNode(symbol.valueDeclaration)];
16-
}
17-
else {
18-
// Perform "Find all References" and retrieve only those that are implementations
19-
const referencedSymbols = FindAllReferences.getReferencedSymbolsForNode(typeChecker, cancellationToken,
20-
node, sourceFiles, /*findInStrings*/false, /*findInComments*/false, /*implementations*/true);
21-
const result = flatMap(referencedSymbols, symbol =>
22-
map(symbol.references, ({ textSpan, fileName }) => ({ textSpan, fileName })));
3+
export function getImplementationAtPosition(typeChecker: TypeChecker, cancellationToken: CancellationToken, sourceFiles: SourceFile[], node: Node): ImplementationLocation[] {
4+
// If invoked directly on a shorthand property assignment, then return
5+
// the declaration of the symbol being assigned (not the symbol being assigned to).
6+
if (node.parent.kind === SyntaxKind.ShorthandPropertyAssignment) {
7+
const result: ReferenceEntry[] = [];
8+
FindAllReferences.getReferenceEntriesForShorthandPropertyAssignment(node, typeChecker, result);
9+
return result.length > 0 ? result : undefined;
10+
}
11+
else if (node.kind === SyntaxKind.SuperKeyword || isSuperProperty(node.parent)) {
12+
// References to and accesses on the super keyword only have one possible implementation, so no
13+
// need to "Find all References"
14+
const symbol = typeChecker.getSymbolAtLocation(node);
15+
return symbol.valueDeclaration && [FindAllReferences.getReferenceEntryFromNode(symbol.valueDeclaration)];
16+
}
17+
else {
18+
// Perform "Find all References" and retrieve only those that are implementations
19+
const referencedSymbols = FindAllReferences.getReferencedSymbolsForNode(typeChecker, cancellationToken,
20+
node, sourceFiles, /*findInStrings*/false, /*findInComments*/false, /*implementations*/true);
21+
const result = flatMap(referencedSymbols, symbol =>
22+
map(symbol.references, ({ textSpan, fileName }) => ({ textSpan, fileName })));
2323

24-
return result && result.length > 0 ? result : undefined;
25-
}
24+
return result && result.length > 0 ? result : undefined;
2625
}
26+
}
2727
}

0 commit comments

Comments
 (0)