zed/crates
Nathan Sobo d3c1966d96
WIP: Return WindowHandle<V: View> from AppContext::add_window (#2820)
Instead of returning a usize for the window id, I'm instead returning a
`WindowHandle<V: View>` where `V` is the type of the window's root view.
@as-cii helped me with a cool technique using generic associated types
where methods on `WindowHandle` can return either T or Option<T>
depending on the `BorrowWindowContext::Result` associated type.

Some example usage...

```rs
let window = cx.add_window(|cx| MyView::new(cx));
let my_view = window.root(cx); // If cx is TestAppContext, returns MyView. Otherwise returns Option<MyView>, because the window could be closed.
```


This isn't insanely beneficial on its own, but I think it will help
clean up our testing story. I'm planning on making `window` more useful
in tests for laying out elements, etc.

- [x] Rework tests that call `add_window` 😅 to expect only a window in
return.
- [x] Get tests passing
- [x] 🚬  test
2023-08-03 18:45:51 -06:00
..
activity_indicator Merge branch 'main' into fix-broken-lsp-installations 2023-06-28 16:46:06 -04:00
ai disable wrap guides in the assitant panel 2023-07-28 22:27:36 -07:00
audio Update collaboration sounds, add sounds to screensharing 2023-07-04 16:18:42 -04:00
auto_update Split out Interactive<T> into Toggle<T> and Interactive<T> 2023-06-20 16:05:20 -07:00
breadcrumbs Split out Interactive<T> into Toggle<T> and Interactive<T> 2023-06-20 16:05:20 -07:00
call Add microphone toggle events (#2765) 2023-07-20 16:10:20 -04:00
cli Prevent duplicate instances by coordinating via a socket 2023-07-07 14:19:44 -04:00
client Add is_staff to events 2023-07-18 12:32:53 -04:00
clock Fixed a bug where buffer saved clocks would desynchronize in rare execution paths 2023-06-07 16:10:45 -07:00
collab WIP: Return WindowHandle<V: View> from AppContext::add_window (#2820) 2023-08-03 18:45:51 -06:00
collab_ui Don't refcount window handles 2023-08-03 17:11:47 -06:00
collections Move command palette filter into collections crate 2023-03-28 20:13:17 -07:00
command_palette Don't refcount window handles 2023-08-03 17:11:47 -06:00
context_menu Introduce a WindowContext::focus method that implies the window id 2023-07-05 09:39:04 +02:00
copilot Use WindowHandles in a couple places 2023-08-03 17:46:34 -06:00
copilot_button Remove on_click_out handler from context menu 2023-06-29 17:10:51 -07:00
db Simplify db tests 2023-07-14 16:09:02 -07:00
diagnostics Don't refcount window handles 2023-08-03 17:11:47 -06:00
drag_and_drop Prevent some cases of clipping icons due to pixel coord rounding 2023-05-08 11:42:00 -04:00
editor WIP: Return WindowHandle<V: View> from AppContext::add_window (#2820) 2023-08-03 18:45:51 -06:00
feedback Prevent multiple submissions of the same feedback text 2023-07-17 16:10:34 -04:00
file_finder Don't refcount window handles 2023-08-03 17:11:47 -06:00
fs Fix pathspec in staged_statuses 2023-07-23 21:36:29 -07:00
fsevent 🎨 Specify more dependencies at the workspace level 2023-04-24 17:41:55 -07:00
fuzzy remove commented line 2023-02-27 12:06:10 -08:00
git Clean up final remaining code paths calling old diff update method 2023-05-25 14:41:09 -04:00
go_to_line Add Modal::has_focus and introduce a ModalHandle trait object 2023-07-05 09:39:56 +02:00
gpui Use WindowHandles in a couple places 2023-08-03 17:46:34 -06:00
gpui_macros Add a derive macro for Element 2023-06-25 07:51:50 -06:00
install_cli 🎨 Specify more dependencies at the workspace level 2023-04-24 17:41:55 -07:00
journal Enable test-support on editor in tests 2023-05-20 09:54:38 -06:00
language fmt 2023-07-27 11:14:21 -07:00
language_selector feat(workspace): allow alternative actions to open files and symbols in split 2023-07-14 21:49:15 +02:00
language_tools WIP 2023-08-03 17:03:39 -06:00
live_kit_client Put LiveKitBridge Swift build directory in target 2023-07-28 18:53:24 -04:00
live_kit_server 🎨 Specify more dependencies at the workspace level 2023-04-24 17:41:55 -07:00
lsp Add scaffolding of php language server 2023-07-17 11:43:32 +02:00
media Update rust-bindgen dev-dependencies 2023-06-04 23:34:22 -04:00
menu feat(workspace): allow alternative actions to open files and symbols in split 2023-07-14 21:49:15 +02:00
node_runtime Reattempt Node installation if the installation itself errors 2023-07-28 15:24:40 -04:00
outline feat(workspace): allow alternative actions to open files and symbols in split 2023-07-14 21:49:15 +02:00
picker feat(workspace): allow alternative actions to open files and symbols in split 2023-07-14 21:49:15 +02:00
plugin 🎨 Specify more dependencies at the workspace level 2023-04-24 17:41:55 -07:00
plugin_macros Fix typos 2023-06-02 22:02:19 -04:00
plugin_runtime Fix typos 2023-06-02 22:02:19 -04:00
project Fix warnings surfaced in Rust 1.71 2023-08-02 09:19:23 -07:00
project_panel WIP: Return WindowHandle<V: View> from AppContext::add_window (#2820) 2023-08-03 18:45:51 -06:00
project_symbols Don't refcount window handles 2023-08-03 17:11:47 -06:00
recent_projects Add PathExt trait (#2823) 2023-08-03 18:57:43 -04:00
rope Simplify InlayMap::splice interface 2023-06-29 22:25:49 +03:00
rpc Post-rebase fixes 2023-06-29 22:39:33 +03:00
search Don't refcount window handles 2023-08-03 17:11:47 -06:00
semantic_index catchup with main 2023-08-01 10:40:38 -04:00
settings Accept null as a valid action, to disable a keystroke 2023-07-04 21:11:28 +03:00
snippet 🎨 Specify more dependencies at the workspace level 2023-04-24 17:41:55 -07:00
sqlez Fix typos 2023-06-02 22:02:19 -04:00
sqlez_macros 🎨 Specify more dependencies at the workspace level 2023-04-24 17:41:55 -07:00
staff_mode 🎨 Specify more dependencies at the workspace level 2023-04-24 17:41:55 -07:00
sum_tree Fix warnings surfaced in Rust 1.71 2023-08-02 09:19:23 -07:00
terminal Update Alacritty 2023-07-27 12:19:07 -04:00
terminal_view WIP 2023-08-03 17:03:39 -06:00
text Remove excessive hint update queries 2023-06-30 22:03:21 +03:00
theme Update status bar theming 2023-07-25 11:06:41 -06:00
theme_selector feat(workspace): allow alternative actions to open files and symbols in split 2023-07-14 21:49:15 +02:00
util Add PathExt trait (#2823) 2023-08-03 18:57:43 -04:00
vcs_menu feat(workspace): allow alternative actions to open files and symbols in split 2023-07-14 21:49:15 +02:00
vim Fix warnings surfaced in Rust 1.71 2023-08-02 09:19:23 -07:00
welcome feat(workspace): allow alternative actions to open files and symbols in split 2023-07-14 21:49:15 +02:00
workspace Don't refcount window handles 2023-08-03 17:11:47 -06:00
xtask Fixup xtask compilation 2023-06-22 18:06:52 +02:00
zed WIP: Return WindowHandle<V: View> from AppContext::add_window (#2820) 2023-08-03 18:45:51 -06:00
zed-actions Add Sign in button for an unregistered user 2023-06-15 22:05:43 -07:00