symbolique 0.1.0

Symbol table pipeline for language servers — parse, link, merge, and resolve symbols across files, built on the laburnum LSP framework.


use a few agents to review the laburnum crate

they are looking for duplicated structs and functions
places where code is performing the same purpose
areas where code could be merged or simplified


  /// Ariadne sources for error reporting with pretty-printed code snippets.
  ariadne_sources: Arc<DashMap<SourceKey, ariadne::Source<String>>>,

  pub(super) ariadne_fetch_cache: Option<ariadne::Source<String>>,



  │ 1        │ Replace line-index with crop's native line tracking │ "Replaces line-index"   │ Medium     │
  ├──────────┼─────────────────────────────────────────────────────┼─────────────────────────┼────────────┤
  │ 2        │ Content-version mapping (hash → version ID)         │ "Content-Version Map"   │ Medium     │
  ├──────────┼─────────────────────────────────────────────────────┼─────────────────────────┼────────────┤
  │ 3        │ File View (per-client view tracking)                │ "File View"             │ Medium     │
  ├──────────┼─────────────────────────────────────────────────────┼─────────────────────────┼────────────┤
  │ 4        │ Eviction logic + reload-and-verify                  │ "File State"            │ High       │
  ├──────────┼─────────────────────────────────────────────────────┼─────────────────────────┼────────────┤
  │ 5        │ UTF-16 offset conversion via crop                   │ "LSP offset conversion" │ Low        │


  8. Create ADR 0002 compliance test suite - Tests explicitly linked to ADR sections

Immediate (Critical for ADR 0002 compliance)

     ☐ Phase 6: Fix parser tests broken by Option-returning APIs

    1. Add SpanCache tests - intern(), lookup(), boundary conditions, saturation
    2. Add restore_evicted integration test - Hash match/mismatch, disk read failure
    3. Add version wraparound tests - 1023→0 with active references

    Short-term

    4. Add to_lsp_range tests - Critical for IDE features
    5. Strengthen weak assertions - Replace <= 3 with exact counts
    6. Add error type assertions - Verify specific error variants

  write up a new plan to fix all of these

the following repos use symbolique:
  - /Users/ojkelly/Code/src/github.com/gold-build/patina/crates/patina/ir

The following need to have first-class support in symbolique:
  - imports
  - types

We need to enforce a specific heirachy of composition

Base
Linked
Merged
Resolved
Typed





Formalise the following behaviours in code and with tests

- Base table
  - declares
    - Definitions
    - Values
    - UnresolvedReferences
    - Scopes

Add to Symbol enum:

 - Import
  - path ident
  - optional alias
  - optional resolves_to
    - resolution stored later, and added when needed


[x] Merge UnresolvedReference with Reference
  - add optional resolves_to


[ ] Both import and reference have resolves_to: None in the Base table

In the ResolvedSymbolTable the resolutions are stored, and added
when the symbol it retrieved.


MergedSymbolTable
 - all top level scopes are merged only
 - get symbol searchs all tables



TypedSymbolTable


---

then update Patina with an explicit import syntax