@@ -513,9 +513,11 @@ export async function activate(ctx: sourcegraph.ExtensionContext): Promise<void>
513513 logger . log ( 'Hover trace' , span . generateTraceURL ( ) )
514514 }
515515
516- if ( await isLSIFAvailable ( textDocument ) ) {
517- const lsifResult = await lsif . hover ( textDocument , position )
518- yield lsifResult && lsifResult . value
516+ const lsifResult = ( await isLSIFAvailable ( textDocument ) )
517+ ? await lsif . hover ( textDocument , position )
518+ : undefined
519+ if ( lsifResult ) {
520+ yield lsifResult . value
519521 } else if ( ! config . value [ 'typescript.serverUrl' ] ) {
520522 yield await basicCodeIntel . hover ( textDocument , position )
521523 } else {
@@ -560,9 +562,11 @@ export async function activate(ctx: sourcegraph.ExtensionContext): Promise<void>
560562 logger . log ( 'Definition trace' , span . generateTraceURL ( ) )
561563 }
562564
563- if ( await isLSIFAvailable ( textDocument ) ) {
564- const lsifResult = await lsif . definition ( textDocument , position )
565- yield lsifResult ? lsifResult . value : null
565+ const lsifResult = ( await isLSIFAvailable ( textDocument ) )
566+ ? await lsif . definition ( textDocument , position )
567+ : undefined
568+ if ( lsifResult ) {
569+ yield lsifResult . value
566570 } else if ( ! config . value [ 'typescript.serverUrl' ] ) {
567571 yield await basicCodeIntel . definition ( textDocument , position )
568572 } else {
@@ -609,11 +613,10 @@ export async function activate(ctx: sourcegraph.ExtensionContext): Promise<void>
609613 logger . log ( 'References trace' , span . generateTraceURL ( ) )
610614 }
611615
612- if ( await isLSIFAvailable ( textDocument ) ) {
613- const lsifResult = await lsif . references ( textDocument , position )
614- yield ( lsifResult && lsifResult . value ) || [ ]
615- } else if ( ! config . value [ 'typescript.serverUrl' ] ) {
616- yield ( await basicCodeIntel . references ( textDocument , position ) ) || [ ]
616+ if ( ! config . value [ 'typescript.serverUrl' ] ) {
617+ const lsifReferences = await lsif . references ( textDocument , position )
618+ const fuzzyReferences = ( await basicCodeIntel . references ( textDocument , position ) ) || [ ]
619+ yield [ ...( lsifReferences === undefined ? [ ] : lsifReferences . value ) , ...fuzzyReferences ]
617620 } else {
618621 const textDocumentUri = new URL ( textDocument . uri )
619622 const serverRootUri = resolveServerRootUri ( textDocumentUri , serverSgEndpoint )
0 commit comments