This repository was archived by the owner on Jun 7, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -614,9 +614,19 @@ export async function activate(ctx: sourcegraph.ExtensionContext): Promise<void>
614614 }
615615
616616 if ( ! config . value [ 'typescript.serverUrl' ] ) {
617+ // Gets an opaque value that is the same for all locations
618+ // within a file but different from other files.
619+ const file = ( loc : sourcegraph . Location ) => `${ loc . uri . host } ${ loc . uri . pathname } ${ loc . uri . hash } `
620+
617621 const lsifReferences = await lsif . references ( textDocument , position )
618622 const fuzzyReferences = ( await basicCodeIntel . references ( textDocument , position ) ) || [ ]
619- yield [ ...( lsifReferences === undefined ? [ ] : lsifReferences . value ) , ...fuzzyReferences ]
623+
624+ const lsifFiles = new Set ( ( lsifReferences ? lsifReferences . value : [ ] ) . map ( file ) )
625+
626+ yield [
627+ ...( lsifReferences === undefined ? [ ] : lsifReferences . value ) ,
628+ ...fuzzyReferences . filter ( fuzzyRef => ! lsifFiles . has ( file ( fuzzyRef ) ) ) ,
629+ ]
620630 } else {
621631 const textDocumentUri = new URL ( textDocument . uri )
622632 const serverRootUri = resolveServerRootUri ( textDocumentUri , serverSgEndpoint )
You can’t perform that action at this time.
0 commit comments