
Fix bugs caused by the window context PR, where the window could be on the stack and is then requested from the App. This PR also adds derive macros for `AppContext` and `VisualContext` so that it's easy to define further contexts in API code, such as `editor::BlockContext`. Release Notes: - N/A
13 lines
293 B
Rust
13 lines
293 B
Rust
#[test]
|
|
fn test_derive_context() {
|
|
use gpui::{App, Window};
|
|
use gpui_macros::{AppContext, VisualContext};
|
|
|
|
#[derive(AppContext, VisualContext)]
|
|
struct _MyCustomContext<'a, 'b> {
|
|
#[app]
|
|
app: &'a mut App,
|
|
#[window]
|
|
window: &'b mut Window,
|
|
}
|
|
}
|