Use UpdateGlobal accessors in more places (#11925)

This PR updates a number of instances that were previously using
`cx.update_global` to use `UpdateGlobal::update_global` instead.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-05-16 13:30:04 -04:00 committed by GitHub
parent c1e291bc96
commit 13bbaf1e18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 66 additions and 68 deletions

View file

@ -1,7 +1,7 @@
use crate::{Event, *};
use fs::FakeFs;
use futures::{future, StreamExt};
use gpui::AppContext;
use gpui::{AppContext, UpdateGlobal};
use language::{
language_settings::{AllLanguageSettings, LanguageSettingsContent},
tree_sitter_rust, tree_sitter_typescript, Diagnostic, FakeLspAdapter, LanguageConfig,
@ -1501,7 +1501,7 @@ async fn test_toggling_enable_language_server(cx: &mut gpui::TestAppContext) {
// Disable Rust language server, ensuring only that server gets stopped.
cx.update(|cx| {
cx.update_global(|settings: &mut SettingsStore, cx| {
SettingsStore::update_global(cx, |settings, cx| {
settings.update_user_settings::<AllLanguageSettings>(cx, |settings| {
settings.languages.insert(
Arc::from("Rust"),
@ -1520,7 +1520,7 @@ async fn test_toggling_enable_language_server(cx: &mut gpui::TestAppContext) {
// Enable Rust and disable JavaScript language servers, ensuring that the
// former gets started again and that the latter stops.
cx.update(|cx| {
cx.update_global(|settings: &mut SettingsStore, cx| {
SettingsStore::update_global(cx, |settings, cx| {
settings.update_user_settings::<AllLanguageSettings>(cx, |settings| {
settings.languages.insert(
Arc::from("Rust"),