@@ -77,7 +77,7 @@ export class FileIndexer {
7777 this . visitSymbolOccurrence ( node , sym )
7878 }
7979 }
80-
80+
8181 ts . forEachChild ( node , node => this . visit ( node ) )
8282 }
8383
@@ -117,7 +117,9 @@ export class FileIndexer {
117117 if ( isDefinitionNode ) {
118118 role |= scip . scip . SymbolRole . Definition
119119 }
120- const declarations = ts . isConstructorDeclaration ( node ) ? [ node ] : isDefinitionNode
120+ const declarations = ts . isConstructorDeclaration ( node )
121+ ? [ node ]
122+ : isDefinitionNode
121123 ? // Don't emit ambiguous definition at definition-site. You can reproduce
122124 // ambiguous results by triggering "Go to definition" in VS Code on `Conflict`
123125 // in the example below:
@@ -131,19 +133,15 @@ export class FileIndexer {
131133 let scipSymbol = this . scipSymbol ( declaration )
132134
133135 if (
134- (
135- (
136- ts . isIdentifier ( node ) &&
137- ts . isNewExpression ( node . parent )
138- ) ||
139- (
140- ts . isPropertyAccessExpression ( node . parent ) &&
141- ts . isNewExpression ( node . parent . parent )
142- )
143- ) &&
136+ ( ( ts . isIdentifier ( node ) && ts . isNewExpression ( node . parent ) ) ||
137+ ( ts . isPropertyAccessExpression ( node . parent ) &&
138+ ts . isNewExpression ( node . parent . parent ) ) ) &&
144139 ts . isClassDeclaration ( declaration )
145140 ) {
146- scipSymbol = ScipSymbol . global ( scipSymbol , methodDescriptor ( "<constructor>" ) )
141+ scipSymbol = ScipSymbol . global (
142+ scipSymbol ,
143+ methodDescriptor ( '<constructor>' )
144+ )
147145 }
148146
149147 if ( scipSymbol . isEmpty ( ) ) {
@@ -491,7 +489,10 @@ export class FileIndexer {
491489 return undefined
492490 }
493491
494- private asSignatureDeclaration ( node : ts . Node , sym : ts . Symbol ) : ts . SignatureDeclaration | undefined {
492+ private asSignatureDeclaration (
493+ node : ts . Node ,
494+ sym : ts . Symbol
495+ ) : ts . SignatureDeclaration | undefined {
495496 const declaration = sym . declarations ?. [ 0 ]
496497 if ( ! declaration ) {
497498 return undefined
@@ -798,5 +799,7 @@ function declarationName(node: ts.Node): ts.Node | undefined {
798799 * ^^^^^^^^^^^^^^^^^^^^^ node.parent
799800 */
800801function isDefinition ( node : ts . Node ) : boolean {
801- return declarationName ( node . parent ) === node || ts . isConstructorDeclaration ( node )
802+ return (
803+ declarationName ( node . parent ) === node || ts . isConstructorDeclaration ( node )
804+ )
802805}
0 commit comments