symbolique 0.1.0

Symbol table pipeline for language servers — parse, link, merge, and resolve symbols across files, built on the laburnum LSP framework.
#![doc = include_str!("../README.md")]
// Copyright Two Neutron Stars Incorporated and contributors
// SPDX-License-Identifier: BlueOak-1.0.0


//! # symbolique
//!
//! Generic, extensible symbol table pipeline for compilers and LSPs.
//!
//! ## Partition-Based Storage
//!
//! Symbols are stored in Laburnum partitions (ADR003):
//!
//! ```text
//! Stage 1: File     → Symbols (CAS shapes) + FileSymbols (path index)
//! Stage 2: Linked   → LinkedSymbols + LinkedSymbolIndex
//! Stage 3: Merged   → MergedSymbols + MergedSymbolIndex
//! Stage 4: Resolved → SymbolResolution (reference mappings)
//! ```
//!
//! ## Writing Symbols
//!
//! Use the [`SymboliqueWriteExt`] extension trait to write symbols during
//! parsing. This is the **only** supported way to write symbols to partitions.
//!
//! ```ignore
//! use symbolique::SymboliqueWriteExt;
//!
//! fn build_symbols<P>(writer: &mut PartitionWriteContextRef<'_, P>)
//! where
//!     P: Partitions,
//!     P::Stores: HasPartition<Symbols<MyValue, MyIdent, String>>
//!              + HasPartition<FileSymbols<MyValue, MyIdent, String>>,
//! {
//!     let handle = writer.write_symbol_definition::<MyValue, MyIdent, String>(
//!         "file|fn|my_func".to_string(),
//!         span,
//!         ident,
//!         Some(value),
//!         SymbolVisibility::Public,
//!     );
//! }
//! ```
//!
//! The extension trait methods:
//! - Store symbol shapes in the `Symbols` partition (content-addressed)
//! - Create index entries in `FileSymbols` (path-keyed with spans)
//! - Return `RecordHandle<Symbols>` for linking to LSP records

pub mod core;
pub mod error;
pub mod partitions;
pub mod resolution;

pub use {
  core::{
    DefaultValue,
    Ident,
    PositionEntry,
    Span,
    StringIdent,
    Symbol,
    SymbolInfo,
    SymbolPath,
    SymbolSortKey,
    SymbolUsage,
    SymbolVisibility,
    Value,
    ValueSpans,
  },
  error::{
    Error,
    Severity,
    SymbolError,
  },
  partitions::{
    FileSymbolIndex,
    FileSymbols,
    LinkedSymbolIndex,
    LinkedSymbols,
    LinkedSymboliqueReadExt,
    LinkedSymboliqueWriteExt,
    MergedSymbolIndex,
    MergedSymbols,
    MergedSymboliqueReadExt,
    MergedSymboliqueWriteExt,
    ResolutionEntry,
    ResolutionReadExt,
    ResolutionWriteExt,
    SymbolEntry,
    SymbolResolution,
    SymboliqueReadExt,
    SymboliqueWriteExt,
    Symbols,
  },
  resolution::{
    DefaultResolver,
    PhantomSymbol,
    Resolution,
    ResolutionResult,
    ResolutionStep,
    SymboliqueResolver,
  },
};

#[cfg(test)]
pub(crate) mod test_helpers;

otel::tracer!();