Expand description
Document symbol provider for .sql files.
Returns the structural outline of a .sql file: the main CREATE statement
as the root symbol, with supporting statements (indexes, grants, comments,
unit tests) as children. This powers the editor’s “Outline” view and
breadcrumb navigation.
§Symbol hierarchy
CREATE VIEW orders (root)
├─ INDEX orders_id_idx
├─ GRANT SELECT TO analyst
├─ COMMENT ON VIEW orders
└─ TEST test_no_nulls§Range handling
The root symbol spans the entire document. Child symbols use zero-width ranges at the start of the file since exact byte offsets for individual supporting statements are not tracked in the typed IR. The hierarchy is the primary value — range precision can be refined later.
Functions§
- child_
symbol 🔒 - Create a child symbol with zero-width range.
- document_
symbols 🔒 - Build the document symbol outline for a
.sqlfile.