Skip to content

make dependents work on constructors#6115

Merged
mitchellwrosen merged 3 commits intotrunkfrom
26-01-14-constructor-dependents
Jan 15, 2026
Merged

make dependents work on constructors#6115
mitchellwrosen merged 3 commits intotrunkfrom
26-01-14-constructor-dependents

Conversation

@mitchellwrosen
Copy link
Member

Overview

Fixes #5246

This PR amends dependents to work better on constructors.

Previously, dependents <constructor> would function like dependents <type>, since that's the fidelity of the information available to us in the dependents index.

To avoid a migration and lengthy development cycle, this PR simply implements dependents <constructor> against the existing database schema.

After fetching term and type dependents with dependents <arg>, if <arg> matches any constructors, we pass back over the results, deserialize the types and terms, crawl the dependencies of the in-memory ABTs, and filter out any dependents without any direct dependencies that overlap <arg>. It's obviously slower than using a database index, so we can reconsider if in practice we are seeing inexcusably slow dependents runs. I tried a couple and they seem fast enough, though.

Test coverage

I tested this manually, and amended the transcript which showed that previously we didn't have constructor-granularity dependents implemented.

@ceedubs
Copy link
Contributor

ceedubs commented Jan 14, 2026

I just gave this a try in a few places and it worked great! In a big codebase like nimbus the results weren't immediate, but they were fast enough that it didn't feel bad. And I don't know how much of that delay was on rendering a large number of results vs the query backing it.

I haven't reviewed the code, but consider this a 👍 for the user experience!

@mitchellwrosen mitchellwrosen marked this pull request as ready for review January 14, 2026 20:44
@aryairani
Copy link
Contributor

Great! Could you add a ticket to track the migration one, but this should be good enough for the foreseeable future.

@mitchellwrosen
Copy link
Member Author

@aryairani #6120

@mitchellwrosen mitchellwrosen merged commit ecf597a into trunk Jan 15, 2026
31 checks passed
@mitchellwrosen mitchellwrosen deleted the 26-01-14-constructor-dependents branch January 15, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

find usages of a constructor

3 participants