1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// Copyright Two Neutron Stars Incorporated and contributors
// SPDX-License-Identifier: BlueOak-1.0.0
//! Laburnum partition-based storage for symbolique.
//!
//! This module implements ADR003's partition-based symbol storage, replacing
//! in-memory SlotMap/HashMap with Laburnum's content-addressed partition
//! system.
//!
//! # Pipeline Stages
//!
//! Symbols flow through 4 stages, each with its own partitions:
//!
//! ```text
//! Stage 1: File → Symbols (CAS) + FileSymbols (index)
//! Stage 2: Linked → LinkedSymbols + LinkedSymbolIndex
//! Stage 3: Merged → MergedSymbols + MergedSymbolIndex
//! Stage 4: Resolved → SymbolResolution (no new shapes)
//! ```
//!
//! # Shapes vs Index
//!
//! Symbol data is split into two partition types:
//!
//! - **[`Symbols`]**: Content-addressed (CAS) partition storing symbol shapes.
//! Enables deduplication across files. One shared partition for all stages.
//! - **Stage partitions** ([`FileSymbols`], etc.): Index-only partitions with
//! path-keyed entries. Each entry contains a span and a `RecordHandle` to
//! the shape in `Symbols`.
//!
//! # Writing Symbols
//!
//! Use the extension traits on `PartitionWriteContextRef`. These are the
//! **only** supported ways to write symbols to partitions:
//!
//! | Stage | Trait | Description |
//! |-------|-------|-------------|
//! | File | [`SymboliqueWriteExt`] | File-level parsing |
//! | Linked | [`LinkedSymboliqueWriteExt`] | Import resolution |
//! | Merged | [`MergedSymboliqueWriteExt`] | Workspace-wide merge |
//! | Resolution | [`ResolutionWriteExt`] | Reference resolution |
//!
//! ```rust,ignore
//! use symbolique::{SymboliqueWriteExt, ResolutionWriteExt};
//!
//! fn build_symbols<P>(writer: &mut PartitionWriteContextRef<'_, P>)
//! where
//! P: Partitions,
//! P::Stores: HasPartition<Symbols<MyValue, MyIdent, String>>
//! + HasPartition<FileSymbols<MyValue, MyIdent, String>>,
//! {
//! // Clear old symbols before re-parsing
//! writer.clear_file_symbols::<MyValue, MyIdent, String>(&file_prefix);
//!
//! // Write symbols - each method stores a shape and creates an index entry
//! let handle = writer.write_symbol_definition::<MyValue, MyIdent, String>(
//! path,
//! span,
//! name,
//! Some(value),
//! SymbolVisibility::Public,
//! );
//!
//! // The returned RecordHandle can be stored in LSP records for linking
//! }
//! ```
// Re-export commonly used types
pub
pub use ;