Cleanups preparing for WindowContext refactor (#22475)

* Remove unnecessary WindowContext and ViewContext '_ lifetimes

* Removed some cases where WindowContext has a different name than `cx`.

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2024-12-28 14:36:14 -07:00 committed by GitHub
parent 9815358bdd
commit 016b5d60e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 127 additions and 152 deletions

View file

@ -143,7 +143,7 @@ fn populate_pane_items(
pane: &mut Pane,
items: Vec<View<TerminalView>>,
active_item: Option<u64>,
cx: &mut ViewContext<'_, Pane>,
cx: &mut ViewContext<Pane>,
) {
let mut item_index = pane.items_len();
for item in items {

View file

@ -867,7 +867,7 @@ impl Element for TerminalElement {
bounds: Bounds<Pixels>,
_: &mut Self::RequestLayoutState,
layout: &mut Self::PrepaintState,
cx: &mut WindowContext<'_>,
cx: &mut WindowContext,
) {
cx.with_content_mask(Some(ContentMask { bounds }), |cx| {
let scroll_top = self.terminal_view.read(cx).scroll_top;

View file

@ -824,7 +824,7 @@ impl TerminalPanel {
task_pane: View<Pane>,
terminal_item_index: usize,
terminal_to_replace: View<TerminalView>,
cx: &mut ViewContext<'_, Self>,
cx: &mut ViewContext<Self>,
) -> Task<Option<()>> {
let reveal = spawn_task.reveal;
let reveal_target = spawn_task.reveal_target;
@ -1122,7 +1122,7 @@ async fn wait_for_terminals_tasks(
let _: Vec<()> = join_all(pending_tasks).await;
}
fn add_paths_to_terminal(pane: &mut Pane, paths: &[PathBuf], cx: &mut ViewContext<'_, Pane>) {
fn add_paths_to_terminal(pane: &mut Pane, paths: &[PathBuf], cx: &mut ViewContext<Pane>) {
if let Some(terminal_view) = pane
.active_item()
.and_then(|item| item.downcast::<TerminalView>())

View file

@ -606,7 +606,7 @@ impl TerminalView {
dispatch_context
}
fn set_terminal(&mut self, terminal: Model<Terminal>, cx: &mut ViewContext<'_, TerminalView>) {
fn set_terminal(&mut self, terminal: Model<Terminal>, cx: &mut ViewContext<TerminalView>) {
self._terminal_subscriptions =
subscribe_for_terminal_events(&terminal, self.workspace.clone(), cx);
self.terminal = terminal;
@ -616,7 +616,7 @@ impl TerminalView {
fn subscribe_for_terminal_events(
terminal: &Model<Terminal>,
workspace: WeakView<Workspace>,
cx: &mut ViewContext<'_, TerminalView>,
cx: &mut ViewContext<TerminalView>,
) -> Vec<Subscription> {
let terminal_subscription = cx.observe(terminal, |_, _, cx| cx.notify());
let terminal_events_subscription =