Skip to content

codeintel: Do not store self-references in lsif_references table

Warren Gifford requested to merge ef/avoid-self-referential-indexes into main

Created by: efritz

In the future we'll want to avoid deleting indexes that are referenced by another visible index. This will be made more difficult if an index can import a symbol from itself (common in a lot of index formats).

This stops adding a reference to the same index inside of the lsif_references table by checking whether or not there will be an entry inserted in the lsif_packages table with the same scheme, name, and version. This may also clean up some conditions in the query path in the future (we no longer have to explicitly de-list our own index when paging references).

Behavior should be identical, but should save some space on useless entries being inserted into the frontend db. We'll need a second pass in th future to clean up existing data that is self-referential.

Partial effort towards #19120 (closed).

Merge request reports

Loading