sqry_classpath/kotlin/mod.rs
1//! Kotlin metadata extraction from `@kotlin.Metadata` annotations.
2//!
3//! Reads the protobuf-encoded metadata to recover Kotlin-specific information
4//! that is lost in bytecode compilation: extension receivers, nullable types,
5//! companion objects, data classes, sealed hierarchies.
6//!
7//! # Architecture
8//!
9//! The `@kotlin.Metadata` annotation embeds a protobuf-encoded blob (`d1`)
10//! alongside a string table (`d2`). This module provides a zero-dependency
11//! protobuf wire-format reader that extracts the specific field numbers used
12//! by `kotlin.metadata.jvm.proto` without requiring a full protobuf runtime.
13//!
14//! # Supported metadata kinds
15//!
16//! Currently only kind=1 (Class) is decoded. Other kinds (file facade,
17//! synthetic, multi-file class) return `None`, falling back to bytecode-only
18//! analysis.
19
20mod decoder;
21
22pub use decoder::{
23 KotlinClassKind, KotlinClassMetadata, KotlinExtensionFunction, KotlinVisibility,
24 decode_kotlin_metadata,
25};