Skip to main content

sqry_classpath/scala/
mod.rs

1//! Scala signature extraction from `@ScalaSignature` annotations.
2//!
3//! Reads the binary-encoded Scala 2 signature format to recover Scala-specific
4//! information: trait vs object vs case class, visibility, sealed/abstract
5//! modifiers, and basic superclass/trait hierarchy.
6//!
7//! # Architecture
8//!
9//! The `@ScalaSignature` annotation embeds a binary entry table (the "Scala 2
10//! signature format", version 5.x) containing symbol definitions with flags
11//! and type references. This module provides:
12//!
13//! - [`signature`] — Low-level binary format reader that parses the entry table
14//!   and provides accessors for individual entries, names, and symbol info.
15//! - [`decoder`] — High-level decoder that produces [`ScalaClassMetadata`] from
16//!   a [`ScalaSignatureStub`](crate::stub::model::ScalaSignatureStub).
17//!
18//! # Supported features (Tier 1)
19//!
20//! - Class kind detection: class, trait, object, package object
21//! - Visibility: public, private, protected
22//! - Modifiers: case, sealed, abstract
23//! - Basic hierarchy: superclass and mixed-in trait names
24//!
25//! # Graceful degradation
26//!
27//! When the signature format is unsupported (e.g., Scala 3 `TASTy`) or the data
28//! is malformed, [`decode_scala_signature`] returns `None` and the caller falls
29//! back to bytecode-only analysis.
30
31mod decoder;
32pub mod signature;
33
34pub use decoder::{ScalaClassKind, ScalaClassMetadata, ScalaVisibility, decode_scala_signature};