repl: Filter commands out of command palette when REPL is disabled (#15016)

This PR makes it so the `repl: ` commands don't appear in the command
palette when the REPL feature is disabled.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-07-23 11:49:56 -04:00 committed by GitHub
parent a5cb66f0e1
commit c262c81e52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 43 additions and 18 deletions

View file

@ -25,6 +25,14 @@ pub use crate::repl_sessions_ui::{
use crate::repl_store::ReplStore;
pub use crate::session::Session;
pub fn init(fs: Arc<dyn Fs>, cx: &mut AppContext) {
set_dispatcher(zed_dispatcher(cx));
JupyterSettings::register(cx);
::editor::init_settings(cx);
repl_sessions_ui::init(cx);
ReplStore::init(fs, cx);
}
fn zed_dispatcher(cx: &mut AppContext) -> impl Dispatcher {
struct ZedDispatcher {
dispatcher: Arc<dyn PlatformDispatcher>,
@ -48,11 +56,3 @@ fn zed_dispatcher(cx: &mut AppContext) -> impl Dispatcher {
dispatcher: cx.background_executor().dispatcher.clone(),
}
}
pub fn init(fs: Arc<dyn Fs>, cx: &mut AppContext) {
set_dispatcher(zed_dispatcher(cx));
JupyterSettings::register(cx);
::editor::init_settings(cx);
repl_sessions_ui::init(cx);
ReplStore::init(fs, cx);
}