Merge pull request #2395 from zed-industries/remove-stable-hiding-copilot
Remove stable guard for copilot
This commit is contained in:
commit
ad71020990
3 changed files with 41 additions and 51 deletions
|
@ -27,8 +27,7 @@ use std::{
|
||||||
sync::Arc,
|
sync::Arc,
|
||||||
};
|
};
|
||||||
use util::{
|
use util::{
|
||||||
channel::ReleaseChannel, fs::remove_matching, github::latest_github_release, http::HttpClient,
|
fs::remove_matching, github::latest_github_release, http::HttpClient, paths, ResultExt,
|
||||||
paths, ResultExt,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const COPILOT_AUTH_NAMESPACE: &'static str = "copilot_auth";
|
const COPILOT_AUTH_NAMESPACE: &'static str = "copilot_auth";
|
||||||
|
@ -41,15 +40,6 @@ actions!(
|
||||||
);
|
);
|
||||||
|
|
||||||
pub fn init(http: Arc<dyn HttpClient>, node_runtime: Arc<NodeRuntime>, cx: &mut AppContext) {
|
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| {
|
|
||||||
filter.filtered_namespaces.insert(COPILOT_NAMESPACE);
|
|
||||||
filter.filtered_namespaces.insert(COPILOT_AUTH_NAMESPACE);
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let copilot = cx.add_model({
|
let copilot = cx.add_model({
|
||||||
let node_runtime = node_runtime.clone();
|
let node_runtime = node_runtime.clone();
|
||||||
move |cx| Copilot::start(http, node_runtime, cx)
|
move |cx| Copilot::start(http, node_runtime, cx)
|
||||||
|
|
|
@ -23,8 +23,7 @@ struct OpenGithub;
|
||||||
const COPILOT_SIGN_UP_URL: &'static str = "https://github.com/features/copilot";
|
const COPILOT_SIGN_UP_URL: &'static str = "https://github.com/features/copilot";
|
||||||
|
|
||||||
pub fn init(cx: &mut AppContext) {
|
pub fn init(cx: &mut AppContext) {
|
||||||
let copilot = Copilot::global(cx).unwrap();
|
if let Some(copilot) = Copilot::global(cx) {
|
||||||
|
|
||||||
let mut code_verification: Option<ViewHandle<CopilotCodeVerification>> = None;
|
let mut code_verification: Option<ViewHandle<CopilotCodeVerification>> = None;
|
||||||
cx.observe(&copilot, move |copilot, cx| {
|
cx.observe(&copilot, move |copilot, cx| {
|
||||||
let status = copilot.read(cx).status();
|
let status = copilot.read(cx).status();
|
||||||
|
@ -69,6 +68,7 @@ pub fn init(cx: &mut AppContext) {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn create_copilot_auth_window(
|
fn create_copilot_auth_window(
|
||||||
cx: &mut AppContext,
|
cx: &mut AppContext,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue