Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Code intel: respect provenance when getting usages#64193

Merged
camdencheek merged 5 commits into
mainfrom
cc/provenance-filter
Jul 31, 2024
Merged

Code intel: respect provenance when getting usages#64193
camdencheek merged 5 commits into
mainfrom
cc/provenance-filter

Conversation

@camdencheek

@camdencheek camdencheek commented Jul 31, 2024

Copy link
Copy Markdown
Member

This updates the new references panel to respect the provenance of an occurrence.

Fixes SRCH-792

Followups:

  • Need to fix pagination behavior. Before, the backend did not actually do any pagination, so I couldn't test this well.

Test plan

Quick manual test that find references now only returns precise references if the occurrence has a precise provenance.

@cla-bot cla-bot Bot added the cla-signed label Jul 31, 2024
Comment on lines +65 to +68
// Override Symbol.species to return Array instead of OccurrenceIndex
public static get [Symbol.species](): ArrayConstructor {
return Array
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated, but this fixes a nasty bug. Basically, calling filter on OccurrenceIndex would use the OccurrenceIndex constructor rather than the Array constructor to create a new object. This is not what we want because the OccurrenceIndex constructor does not have the same shape as the array constructor, and callers expect calling filter (an array method) to return an array

@camdencheek camdencheek marked this pull request as ready for review July 31, 2024 17:54
@camdencheek camdencheek requested a review from a team July 31, 2024 18:06
@camdencheek camdencheek enabled auto-merge (squash) July 31, 2024 18:28
@camdencheek camdencheek merged commit 60d450b into main Jul 31, 2024
@camdencheek camdencheek deleted the cc/provenance-filter branch July 31, 2024 18:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants