1#![allow(unused_variables, dead_code, unused_mut)]
2// todo!() this is to make transition easier.
3
4// Allow binary to be called Zed for a nice application menu when running executable directly
5#![allow(non_snake_case)]
6
7use anyhow::{anyhow, Context as _, Result};
8use backtrace::Backtrace;
9use chrono::Utc;
10use cli::FORCE_CLI_MODE_ENV_VAR_NAME;
11use client::{Client, UserStore};
12use db::kvp::KEY_VALUE_STORE;
13use editor::Editor;
14use fs::RealFs;
15use futures::StreamExt;
16use gpui::{App, AppContext, AsyncAppContext, Context, SemanticVersion, Task};
17use isahc::{prelude::Configurable, Request};
18use language::LanguageRegistry;
19use log::LevelFilter;
20
21use node_runtime::RealNodeRuntime;
22use parking_lot::Mutex;
23use serde::{Deserialize, Serialize};
24use settings::{
25 default_settings, handle_settings_file_changes, watch_config_file, Settings, SettingsStore,
26};
27use simplelog::ConfigBuilder;
28use smol::process::Command;
29use std::{
30 env,
31 ffi::OsStr,
32 fs::OpenOptions,
33 io::{IsTerminal, Write},
34 panic,
35 path::{Path, PathBuf},
36 sync::{
37 atomic::{AtomicU32, Ordering},
38 Arc, Weak,
39 },
40 thread,
41};
42use theme::ActiveTheme;
43use util::{
44 async_maybe,
45 channel::{parse_zed_link, AppCommitSha, ReleaseChannel, RELEASE_CHANNEL},
46 http::{self, HttpClient},
47 paths, ResultExt,
48};
49use uuid::Uuid;
50use welcome::{show_welcome_view, FIRST_OPEN};
51use workspace::{AppState, WorkspaceStore};
52use zed2::{
53 app_menus, build_window_options, ensure_only_instance, handle_cli_connection,
54 handle_keymap_file_changes, initialize_workspace, languages, Assets, IsOnlyInstance,
55 OpenListener, OpenRequest,
56};
57
58mod open_listener;
59
60fn main() {
61 menu::init();
62 zed_actions::init();
63
64 let http = http::client();
65 init_paths();
66 init_logger();
67
68 if ensure_only_instance() != IsOnlyInstance::Yes {
69 return;
70 }
71
72 log::info!("========== starting zed ==========");
73 let app = App::production(Arc::new(Assets));
74
75 let (installation_id, existing_installation_id_found) = app
76 .background_executor()
77 .block(installation_id())
78 .ok()
79 .unzip();
80 let session_id = Uuid::new_v4().to_string();
81 init_panic_hook(&app, installation_id.clone(), session_id.clone());
82
83 let fs = Arc::new(RealFs);
84 let user_settings_file_rx = watch_config_file(
85 &app.background_executor(),
86 fs.clone(),
87 paths::SETTINGS.clone(),
88 );
89 let user_keymap_file_rx = watch_config_file(
90 &app.background_executor(),
91 fs.clone(),
92 paths::KEYMAP.clone(),
93 );
94
95 let login_shell_env_loaded = if stdout_is_a_pty() {
96 Task::ready(())
97 } else {
98 app.background_executor().spawn(async {
99 load_login_shell_environment().await.log_err();
100 })
101 };
102
103 let (listener, mut open_rx) = OpenListener::new();
104 let listener = Arc::new(listener);
105 let open_listener = listener.clone();
106 app.on_open_urls(move |urls, _| open_listener.open_urls(&urls));
107 app.on_reopen(move |cx| {
108 if cx.has_global::<Weak<AppState>>() {
109 if let Some(app_state) = cx.global::<Weak<AppState>>().upgrade() {
110 workspace::open_new(&app_state, cx, |workspace, cx| {
111 Editor::new_file(workspace, &Default::default(), cx)
112 })
113 .detach();
114 }
115 }
116 });
117
118 app.run(move |cx| {
119 cx.set_global(*RELEASE_CHANNEL);
120 if let Some(build_sha) = option_env!("ZED_COMMIT_SHA") {
121 cx.set_global(AppCommitSha(build_sha.into()))
122 }
123
124 cx.set_global(listener.clone());
125
126 load_embedded_fonts(cx);
127
128 let mut store = SettingsStore::default();
129 store
130 .set_default_settings(default_settings().as_ref(), cx)
131 .unwrap();
132 cx.set_global(store);
133 handle_settings_file_changes(user_settings_file_rx, cx);
134 handle_keymap_file_changes(user_keymap_file_rx, cx);
135
136 let client = client::Client::new(http.clone(), cx);
137 let mut languages = LanguageRegistry::new(login_shell_env_loaded);
138 let copilot_language_server_id = languages.next_language_server_id();
139 languages.set_executor(cx.background_executor().clone());
140 languages.set_language_server_download_dir(paths::LANGUAGES_DIR.clone());
141 let languages = Arc::new(languages);
142 let node_runtime = RealNodeRuntime::new(http.clone());
143
144 language::init(cx);
145 languages::init(languages.clone(), node_runtime.clone(), cx);
146 let user_store = cx.build_model(|cx| UserStore::new(client.clone(), http.clone(), cx));
147 let workspace_store = cx.build_model(|cx| WorkspaceStore::new(client.clone(), cx));
148
149 cx.set_global(client.clone());
150
151 theme::init(theme::LoadThemes::All, cx);
152 project::Project::init(&client, cx);
153 client::init(&client, cx);
154 command_palette::init(cx);
155 language::init(cx);
156 editor::init(cx);
157 diagnostics::init(cx);
158 copilot::init(
159 copilot_language_server_id,
160 http.clone(),
161 node_runtime.clone(),
162 cx,
163 );
164 assistant::init(cx);
165 // component_test::init(cx);
166
167 cx.spawn(|_| watch_languages(fs.clone(), languages.clone()))
168 .detach();
169 watch_file_types(fs.clone(), cx);
170
171 languages.set_theme(cx.theme().clone());
172 cx.observe_global::<SettingsStore>({
173 let languages = languages.clone();
174 move |cx| languages.set_theme(cx.theme().clone())
175 })
176 .detach();
177
178 client.telemetry().start(installation_id, session_id, cx);
179 let telemetry_settings = *client::TelemetrySettings::get_global(cx);
180 let event_operation = match existing_installation_id_found {
181 Some(false) => "first open",
182 _ => "open",
183 };
184 client
185 .telemetry()
186 .report_app_event(telemetry_settings, event_operation);
187
188 let app_state = Arc::new(AppState {
189 languages: languages.clone(),
190 client: client.clone(),
191 user_store: user_store.clone(),
192 fs: fs.clone(),
193 build_window_options,
194 workspace_store,
195 node_runtime,
196 });
197 cx.set_global(Arc::downgrade(&app_state));
198
199 audio::init(Assets, cx);
200 auto_update::init(http.clone(), client::ZED_SERVER_URL.clone(), cx);
201
202 workspace::init(app_state.clone(), cx);
203 recent_projects::init(cx);
204
205 go_to_line::init(cx);
206 file_finder::init(cx);
207 outline::init(cx);
208 // project_symbols::init(cx);
209 project_panel::init(Assets, cx);
210 channel::init(&client, user_store.clone(), cx);
211 // diagnostics::init(cx);
212 search::init(cx);
213 semantic_index::init(fs.clone(), http.clone(), languages.clone(), cx);
214 vim::init(cx);
215 terminal_view::init(cx);
216
217 // journal2::init(app_state.clone(), cx);
218 language_selector::init(cx);
219 theme_selector::init(cx);
220 // activity_indicator::init(cx);
221 // language_tools::init(cx);
222 call::init(app_state.client.clone(), app_state.user_store.clone(), cx);
223 collab_ui::init(&app_state, cx);
224 feedback::init(cx);
225 welcome::init(cx);
226
227 cx.set_menus(app_menus());
228 initialize_workspace(app_state.clone(), cx);
229
230 if stdout_is_a_pty() {
231 cx.activate(true);
232 let urls = collect_url_args();
233 if !urls.is_empty() {
234 listener.open_urls(&urls)
235 }
236 } else {
237 upload_previous_panics(http.clone(), cx);
238
239 // TODO Development mode that forces the CLI mode usually runs Zed binary as is instead
240 // of an *app, hence gets no specific callbacks run. Emulate them here, if needed.
241 if std::env::var(FORCE_CLI_MODE_ENV_VAR_NAME).ok().is_some()
242 && !listener.triggered.load(Ordering::Acquire)
243 {
244 listener.open_urls(&collect_url_args())
245 }
246 }
247
248 let mut triggered_authentication = false;
249
250 fn open_paths_and_log_errs(
251 paths: &[PathBuf],
252 app_state: &Arc<AppState>,
253 cx: &mut AppContext,
254 ) {
255 let task = workspace::open_paths(&paths, &app_state, None, cx);
256 cx.spawn(|cx| async move {
257 if let Some((_window, results)) = task.await.log_err() {
258 for result in results {
259 if let Some(Err(e)) = result {
260 log::error!("Error opening path: {}", e);
261 }
262 }
263 }
264 })
265 .detach();
266 }
267
268 match open_rx.try_next() {
269 Ok(Some(OpenRequest::Paths { paths })) => {
270 open_paths_and_log_errs(&paths, &app_state, cx)
271 }
272 Ok(Some(OpenRequest::CliConnection { connection })) => {
273 let app_state = app_state.clone();
274 cx.spawn(move |cx| handle_cli_connection(connection, app_state, cx))
275 .detach();
276 }
277 Ok(Some(OpenRequest::JoinChannel { channel_id: _ })) => {
278 triggered_authentication = true;
279 let app_state = app_state.clone();
280 let client = client.clone();
281 cx.spawn(|mut cx| async move {
282 // ignore errors here, we'll show a generic "not signed in"
283 let _ = authenticate(client, &cx).await;
284 //todo!()
285 // cx.update(|cx| workspace::join_channel(channel_id, app_state, None, cx))
286 // .await
287 anyhow::Ok(())
288 })
289 .detach_and_log_err(cx)
290 }
291 Ok(Some(OpenRequest::OpenChannelNotes { channel_id: _ })) => {
292 todo!()
293 }
294 Ok(None) | Err(_) => cx
295 .spawn({
296 let app_state = app_state.clone();
297 |cx| async move { restore_or_create_workspace(&app_state, cx).await }
298 })
299 .detach(),
300 }
301
302 let app_state = app_state.clone();
303 cx.spawn(|cx| async move {
304 while let Some(request) = open_rx.next().await {
305 match request {
306 OpenRequest::Paths { paths } => {
307 cx.update(|cx| open_paths_and_log_errs(&paths, &app_state, cx))
308 .ok();
309 }
310 OpenRequest::CliConnection { connection } => {
311 let app_state = app_state.clone();
312 cx.spawn(move |cx| {
313 handle_cli_connection(connection, app_state.clone(), cx)
314 })
315 .detach();
316 }
317 OpenRequest::JoinChannel { channel_id: _ } => {
318 todo!()
319 }
320 OpenRequest::OpenChannelNotes { channel_id: _ } => {
321 todo!()
322 }
323 }
324 }
325 })
326 .detach();
327
328 if !triggered_authentication {
329 cx.spawn(|cx| async move { authenticate(client, &cx).await })
330 .detach_and_log_err(cx);
331 }
332 });
333}
334
335async fn authenticate(client: Arc<Client>, cx: &AsyncAppContext) -> Result<()> {
336 if stdout_is_a_pty() {
337 if client::IMPERSONATE_LOGIN.is_some() {
338 client.authenticate_and_connect(false, &cx).await?;
339 }
340 } else if client.has_keychain_credentials(&cx) {
341 client.authenticate_and_connect(true, &cx).await?;
342 }
343 Ok::<_, anyhow::Error>(())
344}
345
346async fn installation_id() -> Result<(String, bool)> {
347 let legacy_key_name = "device_id";
348
349 if let Ok(Some(installation_id)) = KEY_VALUE_STORE.read_kvp(legacy_key_name) {
350 Ok((installation_id, true))
351 } else {
352 let installation_id = Uuid::new_v4().to_string();
353
354 KEY_VALUE_STORE
355 .write_kvp(legacy_key_name.to_string(), installation_id.clone())
356 .await?;
357
358 Ok((installation_id, false))
359 }
360}
361
362async fn restore_or_create_workspace(app_state: &Arc<AppState>, mut cx: AsyncAppContext) {
363 async_maybe!({
364 if let Some(location) = workspace::last_opened_workspace_paths().await {
365 cx.update(|cx| workspace::open_paths(location.paths().as_ref(), app_state, None, cx))?
366 .await
367 .log_err();
368 } else if matches!(KEY_VALUE_STORE.read_kvp(FIRST_OPEN), Ok(None)) {
369 cx.update(|cx| show_welcome_view(app_state, cx)).log_err();
370 } else {
371 cx.update(|cx| {
372 workspace::open_new(app_state, cx, |workspace, cx| {
373 Editor::new_file(workspace, &Default::default(), cx)
374 })
375 .detach();
376 })?;
377 }
378 anyhow::Ok(())
379 })
380 .await
381 .log_err();
382}
383
384fn init_paths() {
385 std::fs::create_dir_all(&*util::paths::CONFIG_DIR).expect("could not create config path");
386 std::fs::create_dir_all(&*util::paths::LANGUAGES_DIR).expect("could not create languages path");
387 std::fs::create_dir_all(&*util::paths::DB_DIR).expect("could not create database path");
388 std::fs::create_dir_all(&*util::paths::LOGS_DIR).expect("could not create logs path");
389}
390
391fn init_logger() {
392 if stdout_is_a_pty() {
393 env_logger::init();
394 } else {
395 let level = LevelFilter::Info;
396
397 // Prevent log file from becoming too large.
398 const KIB: u64 = 1024;
399 const MIB: u64 = 1024 * KIB;
400 const MAX_LOG_BYTES: u64 = MIB;
401 if std::fs::metadata(&*paths::LOG).map_or(false, |metadata| metadata.len() > MAX_LOG_BYTES)
402 {
403 let _ = std::fs::rename(&*paths::LOG, &*paths::OLD_LOG);
404 }
405
406 let log_file = OpenOptions::new()
407 .create(true)
408 .append(true)
409 .open(&*paths::LOG)
410 .expect("could not open logfile");
411
412 let config = ConfigBuilder::new()
413 .set_time_format_str("%Y-%m-%dT%T") //All timestamps are UTC
414 .build();
415
416 simplelog::WriteLogger::init(level, config, log_file).expect("could not initialize logger");
417 }
418}
419
420#[derive(Serialize, Deserialize)]
421struct LocationData {
422 file: String,
423 line: u32,
424}
425
426#[derive(Serialize, Deserialize)]
427struct Panic {
428 thread: String,
429 payload: String,
430 #[serde(skip_serializing_if = "Option::is_none")]
431 location_data: Option<LocationData>,
432 backtrace: Vec<String>,
433 app_version: String,
434 release_channel: String,
435 os_name: String,
436 os_version: Option<String>,
437 architecture: String,
438 panicked_on: i64,
439 #[serde(skip_serializing_if = "Option::is_none")]
440 installation_id: Option<String>,
441 session_id: String,
442}
443
444#[derive(Serialize)]
445struct PanicRequest {
446 panic: Panic,
447 token: String,
448}
449
450static PANIC_COUNT: AtomicU32 = AtomicU32::new(0);
451
452fn init_panic_hook(app: &App, installation_id: Option<String>, session_id: String) {
453 let is_pty = stdout_is_a_pty();
454 let app_metadata = app.metadata();
455
456 panic::set_hook(Box::new(move |info| {
457 let prior_panic_count = PANIC_COUNT.fetch_add(1, Ordering::SeqCst);
458 if prior_panic_count > 0 {
459 // Give the panic-ing thread time to write the panic file
460 loop {
461 std::thread::yield_now();
462 }
463 }
464
465 let thread = thread::current();
466 let thread_name = thread.name().unwrap_or("<unnamed>");
467
468 let payload = info
469 .payload()
470 .downcast_ref::<&str>()
471 .map(|s| s.to_string())
472 .or_else(|| info.payload().downcast_ref::<String>().map(|s| s.clone()))
473 .unwrap_or_else(|| "Box<Any>".to_string());
474
475 if *util::channel::RELEASE_CHANNEL == ReleaseChannel::Dev {
476 let location = info.location().unwrap();
477 let backtrace = Backtrace::new();
478 eprintln!(
479 "Thread {:?} panicked with {:?} at {}:{}:{}\n{:?}",
480 thread_name,
481 payload,
482 location.file(),
483 location.line(),
484 location.column(),
485 backtrace,
486 );
487 std::process::exit(-1);
488 }
489
490 let app_version = client::ZED_APP_VERSION
491 .or(app_metadata.app_version)
492 .map_or("dev".to_string(), |v| v.to_string());
493
494 let backtrace = Backtrace::new();
495 let mut backtrace = backtrace
496 .frames()
497 .iter()
498 .filter_map(|frame| Some(format!("{:#}", frame.symbols().first()?.name()?)))
499 .collect::<Vec<_>>();
500
501 // Strip out leading stack frames for rust panic-handling.
502 if let Some(ix) = backtrace
503 .iter()
504 .position(|name| name == "rust_begin_unwind")
505 {
506 backtrace.drain(0..=ix);
507 }
508
509 let panic_data = Panic {
510 thread: thread_name.into(),
511 payload: payload.into(),
512 location_data: info.location().map(|location| LocationData {
513 file: location.file().into(),
514 line: location.line(),
515 }),
516 app_version: app_version.clone(),
517 release_channel: RELEASE_CHANNEL.display_name().into(),
518 os_name: app_metadata.os_name.into(),
519 os_version: app_metadata
520 .os_version
521 .as_ref()
522 .map(SemanticVersion::to_string),
523 architecture: env::consts::ARCH.into(),
524 panicked_on: Utc::now().timestamp_millis(),
525 backtrace,
526 installation_id: installation_id.clone(),
527 session_id: session_id.clone(),
528 };
529
530 if let Some(panic_data_json) = serde_json::to_string_pretty(&panic_data).log_err() {
531 log::error!("{}", panic_data_json);
532 }
533
534 if !is_pty {
535 if let Some(panic_data_json) = serde_json::to_string(&panic_data).log_err() {
536 let timestamp = chrono::Utc::now().format("%Y_%m_%d %H_%M_%S").to_string();
537 let panic_file_path = paths::LOGS_DIR.join(format!("zed-{}.panic", timestamp));
538 let panic_file = std::fs::OpenOptions::new()
539 .append(true)
540 .create(true)
541 .open(&panic_file_path)
542 .log_err();
543 if let Some(mut panic_file) = panic_file {
544 writeln!(&mut panic_file, "{}", panic_data_json).log_err();
545 panic_file.flush().log_err();
546 }
547 }
548 }
549
550 std::process::abort();
551 }));
552}
553
554fn upload_previous_panics(http: Arc<dyn HttpClient>, cx: &mut AppContext) {
555 let telemetry_settings = *client::TelemetrySettings::get_global(cx);
556
557 cx.background_executor()
558 .spawn(async move {
559 let panic_report_url = format!("{}/api/panic", &*client::ZED_SERVER_URL);
560 let mut children = smol::fs::read_dir(&*paths::LOGS_DIR).await?;
561 while let Some(child) = children.next().await {
562 let child = child?;
563 let child_path = child.path();
564
565 if child_path.extension() != Some(OsStr::new("panic")) {
566 continue;
567 }
568 let filename = if let Some(filename) = child_path.file_name() {
569 filename.to_string_lossy()
570 } else {
571 continue;
572 };
573
574 if !filename.starts_with("zed") {
575 continue;
576 }
577
578 if telemetry_settings.diagnostics {
579 let panic_file_content = smol::fs::read_to_string(&child_path)
580 .await
581 .context("error reading panic file")?;
582
583 let panic = serde_json::from_str(&panic_file_content)
584 .ok()
585 .or_else(|| {
586 panic_file_content
587 .lines()
588 .next()
589 .and_then(|line| serde_json::from_str(line).ok())
590 })
591 .unwrap_or_else(|| {
592 log::error!(
593 "failed to deserialize panic file {:?}",
594 panic_file_content
595 );
596 None
597 });
598
599 if let Some(panic) = panic {
600 let body = serde_json::to_string(&PanicRequest {
601 panic,
602 token: client::ZED_SECRET_CLIENT_TOKEN.into(),
603 })
604 .unwrap();
605
606 let request = Request::post(&panic_report_url)
607 .redirect_policy(isahc::config::RedirectPolicy::Follow)
608 .header("Content-Type", "application/json")
609 .body(body.into())?;
610 let response = http.send(request).await.context("error sending panic")?;
611 if !response.status().is_success() {
612 log::error!("Error uploading panic to server: {}", response.status());
613 }
614 }
615 }
616
617 // We've done what we can, delete the file
618 std::fs::remove_file(child_path)
619 .context("error removing panic")
620 .log_err();
621 }
622 Ok::<_, anyhow::Error>(())
623 })
624 .detach_and_log_err(cx);
625}
626
627async fn load_login_shell_environment() -> Result<()> {
628 let marker = "ZED_LOGIN_SHELL_START";
629 let shell = env::var("SHELL").context(
630 "SHELL environment variable is not assigned so we can't source login environment variables",
631 )?;
632 let output = Command::new(&shell)
633 .args(["-lic", &format!("echo {marker} && /usr/bin/env -0")])
634 .output()
635 .await
636 .context("failed to spawn login shell to source login environment variables")?;
637 if !output.status.success() {
638 Err(anyhow!("login shell exited with error"))?;
639 }
640
641 let stdout = String::from_utf8_lossy(&output.stdout);
642
643 if let Some(env_output_start) = stdout.find(marker) {
644 let env_output = &stdout[env_output_start + marker.len()..];
645 for line in env_output.split_terminator('\0') {
646 if let Some(separator_index) = line.find('=') {
647 let key = &line[..separator_index];
648 let value = &line[separator_index + 1..];
649 env::set_var(key, value);
650 }
651 }
652 log::info!(
653 "set environment variables from shell:{}, path:{}",
654 shell,
655 env::var("PATH").unwrap_or_default(),
656 );
657 }
658
659 Ok(())
660}
661
662fn stdout_is_a_pty() -> bool {
663 std::env::var(FORCE_CLI_MODE_ENV_VAR_NAME).ok().is_none() && std::io::stdout().is_terminal()
664}
665
666fn collect_url_args() -> Vec<String> {
667 env::args()
668 .skip(1)
669 .filter_map(|arg| match std::fs::canonicalize(Path::new(&arg)) {
670 Ok(path) => Some(format!("file://{}", path.to_string_lossy())),
671 Err(error) => {
672 if let Some(_) = parse_zed_link(&arg) {
673 Some(arg)
674 } else {
675 log::error!("error parsing path argument: {}", error);
676 None
677 }
678 }
679 })
680 .collect()
681}
682
683fn load_embedded_fonts(cx: &AppContext) {
684 let asset_source = cx.asset_source();
685 let font_paths = asset_source.list("fonts").unwrap();
686 let embedded_fonts = Mutex::new(Vec::new());
687 let executor = cx.background_executor();
688
689 executor.block(executor.scoped(|scope| {
690 for font_path in &font_paths {
691 if !font_path.ends_with(".ttf") {
692 continue;
693 }
694
695 scope.spawn(async {
696 let font_bytes = asset_source.load(font_path).unwrap().to_vec();
697 embedded_fonts.lock().push(Arc::from(font_bytes));
698 });
699 }
700 }));
701
702 cx.text_system()
703 .add_fonts(&embedded_fonts.into_inner())
704 .unwrap();
705}
706
707#[cfg(debug_assertions)]
708async fn watch_languages(fs: Arc<dyn fs::Fs>, languages: Arc<LanguageRegistry>) -> Option<()> {
709 use std::time::Duration;
710
711 let mut events = fs
712 .watch(
713 "crates/zed2/src/languages".as_ref(),
714 Duration::from_millis(100),
715 )
716 .await;
717 while (events.next().await).is_some() {
718 languages.reload();
719 }
720 Some(())
721}
722
723#[cfg(debug_assertions)]
724fn watch_file_types(fs: Arc<dyn fs::Fs>, cx: &mut AppContext) {
725 use std::time::Duration;
726
727 cx.spawn(|mut cx| async move {
728 let mut events = fs
729 .watch(
730 "assets/icons/file_icons/file_types.json".as_ref(),
731 Duration::from_millis(100),
732 )
733 .await;
734 while (events.next().await).is_some() {
735 cx.update(|cx| {
736 cx.update_global(|file_types, _| {
737 *file_types = project_panel::file_associations::FileAssociations::new(Assets);
738 });
739 })
740 .ok();
741 }
742 })
743 .detach()
744}
745
746#[cfg(not(debug_assertions))]
747async fn watch_languages(_: Arc<dyn fs::Fs>, _: Arc<LanguageRegistry>) -> Option<()> {
748 None
749}
750
751#[cfg(not(debug_assertions))]
752fn watch_file_types(_fs: Arc<dyn fs::Fs>, _cx: &mut AppContext) {}