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

@ -149,7 +149,7 @@ impl SearchState {
previous_matches: HashMap<Range<editor::Anchor>, Arc<OnceLock<SearchData>>>,
new_matches: Vec<Range<editor::Anchor>>,
theme: Arc<SyntaxTheme>,
cx: &mut ViewContext<'_, OutlinePanel>,
cx: &mut ViewContext<OutlinePanel>,
) -> Self {
let (highlight_search_match_tx, highlight_search_match_rx) = channel::unbounded();
let (notify_tx, notify_rx) = channel::unbounded::<()>();
@ -1661,7 +1661,7 @@ impl OutlinePanel {
}
}
fn reveal_entry_for_selection(&mut self, editor: View<Editor>, cx: &mut ViewContext<'_, Self>) {
fn reveal_entry_for_selection(&mut self, editor: View<Editor>, cx: &mut ViewContext<Self>) {
if !self.active || !OutlinePanelSettings::get_global(cx).auto_reveal_entries {
return;
}
@ -2656,7 +2656,7 @@ impl OutlinePanel {
self.clear_previous(cx);
let buffer_search_subscription = cx.subscribe(
&new_active_editor,
|outline_panel: &mut Self, _, e: &SearchEvent, cx: &mut ViewContext<'_, Self>| {
|outline_panel: &mut Self, _, e: &SearchEvent, cx: &mut ViewContext<Self>| {
if matches!(e, SearchEvent::MatchesInvalidated) {
outline_panel.update_search_matches(cx);
};
@ -2675,7 +2675,7 @@ impl OutlinePanel {
self.update_fs_entries(new_active_editor, None, cx);
}
fn clear_previous(&mut self, cx: &mut WindowContext<'_>) {
fn clear_previous(&mut self, cx: &mut WindowContext) {
self.fs_entries_update_task = Task::ready(());
self.outline_fetch_tasks.clear();
self.cached_entries_update_task = Task::ready(());
@ -3124,7 +3124,7 @@ impl OutlinePanel {
&self,
is_singleton: bool,
query: Option<String>,
cx: &mut ViewContext<'_, Self>,
cx: &mut ViewContext<Self>,
) -> Task<(Vec<CachedEntry>, Option<usize>)> {
let project = self.project.clone();
let Some(active_editor) = self.active_editor() else {
@ -4078,7 +4078,7 @@ impl OutlinePanel {
query: Option<String>,
show_indent_guides: bool,
indent_size: f32,
cx: &mut ViewContext<'_, Self>,
cx: &mut ViewContext<Self>,
) -> Div {
let contents = if self.cached_entries.is_empty() {
let header = if self.updating_fs_entries {
@ -4266,7 +4266,7 @@ impl OutlinePanel {
v_flex().w_full().flex_1().overflow_hidden().child(contents)
}
fn render_filter_footer(&mut self, pinned: bool, cx: &mut ViewContext<'_, Self>) -> Div {
fn render_filter_footer(&mut self, pinned: bool, cx: &mut ViewContext<Self>) -> Div {
v_flex().flex_none().child(horizontal_separator(cx)).child(
h_flex()
.p_2()