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
//! Internal JSON plugin — provides JSON-specific imports, type annotations,
//! and module helpers through the `EmitterPlugin` trait.
//!
//! This module is the counterpart to `super::bincode`. It lives inside the
//! core crate so it can share types and feature constants.
//!
//! # What the plugin handles
//!
//! | Extension point | What it provides |
//! |---|---|
//! | `imports` | `kotlinx.serialization.*` imports (Kotlin), `import Serde` (Swift) |
//! | `module_helpers` | BigInt JSON helper (Kotlin); feature snippets (Swift) |
//! | `type_annotations` | `@Serializable`, `@SerialName("…")` above each type (Kotlin) |
//! | `type_body` | `val serialName` accessor for enum classes (Kotlin); `serialize` / `deserialize` + `jsonSerialize` / `jsonDeserialize` wrappers (Swift) |
//! | `has_type_body` | Always `true` (Swift) |
//!
/// JSON serialization plugin.
///
/// When added to a language tag's plugin list, it provides the
/// JSON-related imports, annotations, feature helpers, and manifest
/// dependencies for that language.
///
/// Each target language has its own `impl EmitterPlugin<Lang>` in a
/// submodule (e.g. [`kotlin`]).
;