Remove unneeded anonymous lifetimes from gpui::Context
(#27686)
This PR removes a number of unneeded anonymous lifetimes from usages of `gpui::Context`. Release Notes: - N/A
This commit is contained in:
parent
e90411efa2
commit
b5dc09c0ca
32 changed files with 80 additions and 87 deletions
|
@ -466,7 +466,7 @@ impl BreakpointStore {
|
|||
pub fn with_serialized_breakpoints(
|
||||
&self,
|
||||
breakpoints: BTreeMap<Arc<Path>, Vec<SerializedBreakpoint>>,
|
||||
cx: &mut Context<'_, BreakpointStore>,
|
||||
cx: &mut Context<BreakpointStore>,
|
||||
) -> Task<Result<()>> {
|
||||
if let BreakpointStoreMode::Local(mode) = &self.mode {
|
||||
let mode = mode.clone();
|
||||
|
|
|
@ -851,7 +851,7 @@ fn create_new_session(
|
|||
session_id: SessionId,
|
||||
initialized_rx: oneshot::Receiver<()>,
|
||||
start_client_task: Task<Result<Entity<Session>, anyhow::Error>>,
|
||||
cx: &mut Context<'_, DapStore>,
|
||||
cx: &mut Context<DapStore>,
|
||||
) -> Task<Result<Entity<Session>>> {
|
||||
let task = cx.spawn(async move |this, cx| {
|
||||
let session = match start_client_task.await {
|
||||
|
|
|
@ -1427,7 +1427,7 @@ impl Session {
|
|||
fn clear_active_debug_line_response(
|
||||
&mut self,
|
||||
response: Result<()>,
|
||||
cx: &mut Context<'_, Session>,
|
||||
cx: &mut Context<Session>,
|
||||
) -> Option<()> {
|
||||
response.log_err()?;
|
||||
self.clear_active_debug_line(cx);
|
||||
|
@ -1931,7 +1931,7 @@ fn create_local_session(
|
|||
mut message_rx: futures::channel::mpsc::UnboundedReceiver<Message>,
|
||||
mode: LocalMode,
|
||||
capabilities: Capabilities,
|
||||
cx: &mut Context<'_, Session>,
|
||||
cx: &mut Context<Session>,
|
||||
) -> Session {
|
||||
let _background_tasks = vec![cx.spawn(async move |this: WeakEntity<Session>, cx| {
|
||||
let mut initialized_tx = Some(initialized_tx);
|
||||
|
|
|
@ -984,7 +984,7 @@ impl GitStore {
|
|||
fn update_repositories(
|
||||
&mut self,
|
||||
worktree_store: &Entity<WorktreeStore>,
|
||||
cx: &mut Context<'_, GitStore>,
|
||||
cx: &mut Context<GitStore>,
|
||||
) {
|
||||
let mut new_repositories = HashMap::default();
|
||||
let git_store = cx.weak_entity();
|
||||
|
|
|
@ -2960,7 +2960,7 @@ impl LocalLspStore {
|
|||
fn remove_worktree(
|
||||
&mut self,
|
||||
id_to_remove: WorktreeId,
|
||||
cx: &mut Context<'_, LspStore>,
|
||||
cx: &mut Context<LspStore>,
|
||||
) -> Vec<LanguageServerId> {
|
||||
self.diagnostics.remove(&id_to_remove);
|
||||
self.prettier_store.update(cx, |prettier_store, cx| {
|
||||
|
@ -3567,7 +3567,7 @@ impl LspStore {
|
|||
client: AnyProtoClient,
|
||||
upstream_project_id: u64,
|
||||
request: R,
|
||||
cx: &mut Context<'_, LspStore>,
|
||||
cx: &mut Context<LspStore>,
|
||||
) -> Task<anyhow::Result<<R as LspCommand>::Response>> {
|
||||
let message = request.to_proto(upstream_project_id, buffer.read(cx));
|
||||
cx.spawn(async move |this, cx| {
|
||||
|
@ -4297,7 +4297,7 @@ impl LspStore {
|
|||
cx.notify();
|
||||
}
|
||||
|
||||
fn refresh_server_tree(&mut self, cx: &mut Context<'_, Self>) {
|
||||
fn refresh_server_tree(&mut self, cx: &mut Context<Self>) {
|
||||
let buffer_store = self.buffer_store.clone();
|
||||
if let Some(local) = self.as_local_mut() {
|
||||
let mut adapters = BTreeMap::default();
|
||||
|
@ -6643,7 +6643,7 @@ impl LspStore {
|
|||
buffer: &Entity<Buffer>,
|
||||
position: Option<P>,
|
||||
request: R,
|
||||
cx: &mut Context<'_, Self>,
|
||||
cx: &mut Context<Self>,
|
||||
) -> Task<Vec<R::Response>>
|
||||
where
|
||||
P: ToOffset,
|
||||
|
|
|
@ -3770,7 +3770,7 @@ impl Project {
|
|||
&mut self,
|
||||
source: WorktreeId,
|
||||
destination: WorktreeId,
|
||||
cx: &mut Context<'_, Self>,
|
||||
cx: &mut Context<Self>,
|
||||
) -> Result<()> {
|
||||
self.worktree_store.update(cx, |worktree_store, cx| {
|
||||
worktree_store.move_worktree(source, destination, cx)
|
||||
|
|
|
@ -725,7 +725,7 @@ impl SettingsObserver {
|
|||
fs: Arc<dyn Fs>,
|
||||
task_kind: TaskKind,
|
||||
file_path: PathBuf,
|
||||
cx: &mut Context<'_, Self>,
|
||||
cx: &mut Context<Self>,
|
||||
) -> Task<()> {
|
||||
let mut user_tasks_file_rx =
|
||||
watch_config_file(&cx.background_executor(), fs, file_path.clone());
|
||||
|
|
|
@ -162,7 +162,7 @@ impl TaskStore {
|
|||
worktree_store: Entity<WorktreeStore>,
|
||||
toolchain_store: Arc<dyn LanguageToolchainStore>,
|
||||
environment: Entity<ProjectEnvironment>,
|
||||
cx: &mut Context<'_, Self>,
|
||||
cx: &mut Context<Self>,
|
||||
) -> Self {
|
||||
Self::Functional(StoreState {
|
||||
mode: StoreMode::Local {
|
||||
|
@ -182,7 +182,7 @@ impl TaskStore {
|
|||
toolchain_store: Arc<dyn LanguageToolchainStore>,
|
||||
upstream_client: AnyProtoClient,
|
||||
project_id: u64,
|
||||
cx: &mut Context<'_, Self>,
|
||||
cx: &mut Context<Self>,
|
||||
) -> Self {
|
||||
Self::Functional(StoreState {
|
||||
mode: StoreMode::Remote {
|
||||
|
@ -265,7 +265,7 @@ impl TaskStore {
|
|||
location: TaskSettingsLocation<'_>,
|
||||
raw_tasks_json: Option<&str>,
|
||||
task_type: TaskKind,
|
||||
cx: &mut Context<'_, Self>,
|
||||
cx: &mut Context<Self>,
|
||||
) -> Result<(), InvalidSettingsError> {
|
||||
let task_inventory = match self {
|
||||
TaskStore::Functional(state) => &state.task_inventory,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue