Add TestPanic feature flag (#34963)
Now the `dev: panic` action can be run on all release channels if the user has the feature flag enabled. Release Notes: - N/A
This commit is contained in:
parent
56b64b1d3f
commit
5f0edd38f8
4 changed files with 16 additions and 11 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -20211,6 +20211,7 @@ dependencies = [
|
|||
"extension",
|
||||
"extension_host",
|
||||
"extensions_ui",
|
||||
"feature_flags",
|
||||
"feedback",
|
||||
"file_finder",
|
||||
"fs",
|
||||
|
|
|
@ -85,6 +85,11 @@ impl FeatureFlag for ThreadAutoCaptureFeatureFlag {
|
|||
false
|
||||
}
|
||||
}
|
||||
pub struct PanicFeatureFlag;
|
||||
|
||||
impl FeatureFlag for PanicFeatureFlag {
|
||||
const NAME: &'static str = "panic";
|
||||
}
|
||||
|
||||
pub struct JjUiFeatureFlag {}
|
||||
|
||||
|
|
|
@ -56,6 +56,7 @@ env_logger.workspace = true
|
|||
extension.workspace = true
|
||||
extension_host.workspace = true
|
||||
extensions_ui.workspace = true
|
||||
feature_flags.workspace = true
|
||||
feedback.workspace = true
|
||||
file_finder.workspace = true
|
||||
fs.workspace = true
|
||||
|
|
|
@ -19,6 +19,7 @@ use collections::VecDeque;
|
|||
use debugger_ui::debugger_panel::DebugPanel;
|
||||
use editor::ProposedChangesEditorToolbar;
|
||||
use editor::{Editor, MultiBuffer};
|
||||
use feature_flags::{FeatureFlagAppExt, PanicFeatureFlag};
|
||||
use futures::future::Either;
|
||||
use futures::{StreamExt, channel::mpsc, select_biased};
|
||||
use git_ui::git_panel::GitPanel;
|
||||
|
@ -53,9 +54,12 @@ use settings::{
|
|||
initial_local_debug_tasks_content, initial_project_settings_content, initial_tasks_content,
|
||||
update_settings_file,
|
||||
};
|
||||
use std::path::PathBuf;
|
||||
use std::sync::atomic::{self, AtomicBool};
|
||||
use std::{borrow::Cow, path::Path, sync::Arc};
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
path::{Path, PathBuf},
|
||||
sync::Arc,
|
||||
sync::atomic::{self, AtomicBool},
|
||||
};
|
||||
use terminal_view::terminal_panel::{self, TerminalPanel};
|
||||
use theme::{ActiveTheme, ThemeSettings};
|
||||
use ui::{PopoverMenuHandle, prelude::*};
|
||||
|
@ -120,11 +124,9 @@ pub fn init(cx: &mut App) {
|
|||
cx.on_action(quit);
|
||||
|
||||
cx.on_action(|_: &RestoreBanner, cx| title_bar::restore_banner(cx));
|
||||
|
||||
if ReleaseChannel::global(cx) == ReleaseChannel::Dev {
|
||||
cx.on_action(test_panic);
|
||||
if ReleaseChannel::global(cx) == ReleaseChannel::Dev || cx.has_flag::<PanicFeatureFlag>() {
|
||||
cx.on_action(|_: &TestPanic, _| panic!("Ran the TestPanic action"));
|
||||
}
|
||||
|
||||
cx.on_action(|_: &OpenLog, cx| {
|
||||
with_active_or_new_workspace(cx, |workspace, window, cx| {
|
||||
open_log_file(workspace, window, cx);
|
||||
|
@ -987,10 +989,6 @@ fn about(
|
|||
.detach();
|
||||
}
|
||||
|
||||
fn test_panic(_: &TestPanic, _: &mut App) {
|
||||
panic!("Ran the TestPanic action")
|
||||
}
|
||||
|
||||
fn install_cli(
|
||||
_: &mut Workspace,
|
||||
_: &install_cli::Install,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue