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
- Resolve identifier parts to an
ObjectId(reusesgoto_definition::resolve_object_id). - Query
ProjectCache::get_dependentsto find all objects that depend on the target. - For each dependent, look up its source file path via
ProjectCache::get_objectand return an LSPLocation.
§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
Locationpointing to the start of a source file. - find_
references 🔒 - Find all project objects that reference the identified object.