Merge MutableAppContext into AppContext
There may have been a good reason for the difference at some point, or I was still learning Rust. But now it's just &mut AppContext vs &AppContext.
This commit is contained in:
parent
dd00966cc6
commit
de9bf6dfbd
112 changed files with 882 additions and 1041 deletions
|
@ -6,10 +6,7 @@ use async_compression::futures::bufread::GzipDecoder;
|
|||
use async_tar::Archive;
|
||||
use collections::HashMap;
|
||||
use futures::{future::Shared, Future, FutureExt, TryFutureExt};
|
||||
use gpui::{
|
||||
actions, AppContext, AsyncAppContext, Entity, ModelContext, ModelHandle, MutableAppContext,
|
||||
Task,
|
||||
};
|
||||
use gpui::{actions, AppContext, AsyncAppContext, Entity, ModelContext, ModelHandle, Task};
|
||||
use language::{point_from_lsp, point_to_lsp, Anchor, Bias, Buffer, Language, ToPointUtf16};
|
||||
use log::{debug, error};
|
||||
use lsp::LanguageServer;
|
||||
|
@ -34,7 +31,7 @@ actions!(copilot_auth, [SignIn, SignOut]);
|
|||
const COPILOT_NAMESPACE: &'static str = "copilot";
|
||||
actions!(copilot, [NextSuggestion, PreviousSuggestion, Reinstall]);
|
||||
|
||||
pub fn init(http: Arc<dyn HttpClient>, node_runtime: Arc<NodeRuntime>, cx: &mut MutableAppContext) {
|
||||
pub fn init(http: Arc<dyn HttpClient>, node_runtime: Arc<NodeRuntime>, cx: &mut AppContext) {
|
||||
// Disable Copilot for stable releases.
|
||||
if *cx.global::<ReleaseChannel>() == ReleaseChannel::Stable {
|
||||
cx.update_global::<collections::CommandPaletteFilter, _, _>(|filter, _cx| {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::{request::PromptUserDeviceFlow, Copilot, Status};
|
||||
use gpui::{
|
||||
elements::*, geometry::rect::RectF, ClipboardItem, Element, Entity, MutableAppContext, View,
|
||||
elements::*, geometry::rect::RectF, ClipboardItem, Element, Entity, AppContext, View,
|
||||
ViewContext, ViewHandle, WindowKind, WindowOptions,
|
||||
};
|
||||
use settings::Settings;
|
||||
|
@ -14,7 +14,7 @@ struct OpenGithub;
|
|||
|
||||
const COPILOT_SIGN_UP_URL: &'static str = "https://github.com/features/copilot";
|
||||
|
||||
pub fn init(cx: &mut MutableAppContext) {
|
||||
pub fn init(cx: &mut AppContext) {
|
||||
let copilot = Copilot::global(cx).unwrap();
|
||||
|
||||
let mut code_verification: Option<ViewHandle<CopilotCodeVerification>> = None;
|
||||
|
@ -57,7 +57,7 @@ pub fn init(cx: &mut MutableAppContext) {
|
|||
}
|
||||
|
||||
fn create_copilot_auth_window(
|
||||
cx: &mut MutableAppContext,
|
||||
cx: &mut AppContext,
|
||||
status: &Status,
|
||||
code_verification: &mut Option<ViewHandle<CopilotCodeVerification>>,
|
||||
) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue