Skip to main content

Module references

Module references 

Source
Expand description

Find-references for SQL identifiers.

Given a cursor position on an identifier, finds all project objects that depend on the referenced object. This is the inverse of go-to-definition: where go-to-definition answers “where is this defined?”, find-references answers “who uses this?”

§Algorithm

  1. Resolve identifier parts to an ObjectId (reuses goto_definition::resolve_object_id).
  2. Query ProjectCache::get_dependents to find all objects that depend on the target.
  3. For each dependent, look up its source file path via ProjectCache::get_object and return an LSP Location.

§Includes the definition

When include_declaration is true (standard LSP behavior), the defining file is prepended to the results so the user sees the full picture.

Functions§

file_location 🔒
Build a Location pointing to the start of a source file.
find_references 🔒
Find all project objects that reference the identified object.