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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
//! gpuikit
//!
//! A comprehensive UI component library for GPUI applications.
//!
//! # Quick Start
//!
//! ```ignore
//! use gpui::Application;
//! use gpuikit::init;
//!
//! fn main() {
//! Application::new()
//! .with_assets(gpuikit::assets())
//! .run(|cx| {
//! init(cx);
//! // ... your app code
//! });
//! }
//! ```
//!
//! # Feature Flags
//!
//! All features are off by default.
//!
//! - `editor` — the editor component, and the syntect-backed syntax
//! highlighting markdown code fences use once an app calls
//! `markdown::init_code_highlighting` (itself gated on this feature)
//! - `stitch` — closes the syntax a partially streamed markdown document leaves
//! open (`**bold`, `[label](htt`) before parsing, so streaming text does not
//! flicker between literal markers and styled text. Pulls in
//! [mdstitch](https://docs.rs/mdstitch), which **requires Rust 1.95**;
//! [`markdown::preprocessing_available`] reports which build you got
//! - `runtime_shaders` — compiles Metal shaders at runtime rather than at build
//! time, so a macOS build needs no Xcode Metal toolchain
//! - `schema` — adds the `schemars` dependency. Nothing here derives
//! `JsonSchema` yet, so today this only affects your dependency graph
//!
//! # Minimum Rust version
//!
//! This crate declares `rust-version = "1.85"`, which is a statement about its
//! own source — async closures, and gpui's edition 2024 — rather than a
//! guarantee about a whole build. gpuikit is edition 2021, so cargo's v2
//! feature resolver does not hold dependencies back to that floor, and several
//! already declare more (cosmic-text and smol_str 1.89, oo7 1.92 on Linux); on
//! a toolchain near 1.85 you will most likely meet one of theirs first. A
//! recent stable is the practical answer.
//!
//! The `stitch` feature raises gpuikit's own floor to **1.95**. It is the only
//! one that does.
use App;
use RustEmbed;
// Core modules
// Feature-gated editor module
pub use Icons as DefaultIcons;
/// Tests for the release workflows' version guard — that the version either of
/// them would publish is the one `CHANGELOG.md` names. `release.yml` computes
/// the version; `release-deploy.yml` is the one that runs `cargo publish`, and
/// it is reachable without `release.yml` having run at all, so both carry it.
///
/// No runtime code, and nothing outside a test build: the module exists
/// because `cargo test --lib` is the only thing in this repository that can
/// check a workflow before it runs for real. See its own docs.
/// Tests for the rule that keeps a workflow's outside values out of its shell
/// — no `${{ }}` inside a `run:` body, and free-form values judged in a step of
/// their own before anything uses them.
///
/// No runtime code, and nothing outside a test build. Covers every workflow in
/// `.github/workflows/`, which a test enforces by reading the directory. See
/// its own docs.
/// Tests for the build configuration that keeps `ld` from being OOM-killed
/// while linking this crate's eight examples — the dev profile's debug level,
/// Linux's `split-debuginfo`, and the `examples` feature every `[[example]]`
/// requires.
///
/// No runtime code, and nothing outside a test build. One test reads
/// `examples/` from disk, because a new undeclared file there is autodiscovered
/// as a target and cannot carry `required-features`. See its own docs.
/// Tests for the rule that this crate creates no thread it cannot join — no
/// `smol` / `async-io` dependency, no `smol::` or `async_io::` in the source,
/// and the two delays (cursor blink, toast auto-dismiss) scheduled on gpui's
/// `BackgroundExecutor::timer`.
///
/// No runtime code, and nothing outside a test build. The `async-io` thread's
/// `main_loop` has no exit path, so it raced process teardown and aborted a
/// fully green `cargo test --lib` (#190). See its own docs.
/// Tests for the rule that runtime code stays runnable on
/// `wasm32-unknown-unknown` — no `std::time::Instant`/`SystemTime`,
/// `std::fs`, or `std::thread::spawn` outside an explicit allowlist of
/// native-only APIs and test-only code. These compile for wasm and then
/// panic or error in the browser, which no local `cargo test` would catch.
///
/// No runtime code, and nothing outside a test build. See its own docs, and
/// <https://github.com/iamnbutler/gpuikit-demo> for gpuikit running on wasm.
/// Embedded assets for gpuikit (icons, fonts, etc.)
;
/// Returns the gpuikit asset source for use with `Application::new().with_assets()`.
///
/// # Example
/// ```ignore
/// Application::new()
/// .with_assets(gpuikit::assets())
/// .run(|cx| {
/// gpuikit::init(cx);
/// // ...
/// });
/// ```
/// Initialize gpuikit - sets up themes and global state.
///
/// This must be called as soon as possible after your `gpui::Application` is created.
/// Make sure to also call `.with_assets(gpuikit::Assets)` on your Application.
///
/// # Panics
/// Calling a gpuikit component before initialization will panic.