Skip to main content

Module document_symbol

Module document_symbol 

Source
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 .sql file.