From 8931218dc6ef6d1476c4537f3ff6b17dc74f0370 Mon Sep 17 00:00:00 2001 From: Isaac Clayton Date: Fri, 8 Jul 2022 21:28:35 +0200 Subject: [PATCH] Remove debug statements --- crates/language/src/language.rs | 13 +++++-------- crates/plugin_runtime/src/lib.rs | 2 -- crates/plugin_runtime/src/plugin.rs | 2 -- crates/project/src/project.rs | 6 ------ crates/zed/src/main.rs | 1 - plugins/json_language/src/lib.rs | 1 - plugins/test_plugin/src/lib.rs | 3 +-- 7 files changed, 6 insertions(+), 22 deletions(-) diff --git a/crates/language/src/language.rs b/crates/language/src/language.rs index a3aa65e53f..38f2306eeb 100644 --- a/crates/language/src/language.rs +++ b/crates/language/src/language.rs @@ -394,14 +394,11 @@ impl LanguageRegistry { .read() .iter() .find(|language| { - language.config.path_suffixes.iter().any(|suffix| { - if path_suffixes.contains(&Some(suffix.as_str())) { - dbg!(format!("found {}", suffix)); - true - } else { - false - } - }) + language + .config + .path_suffixes + .iter() + .any(|suffix| path_suffixes.contains(&Some(suffix.as_str()))) }) .cloned() } diff --git a/crates/plugin_runtime/src/lib.rs b/crates/plugin_runtime/src/lib.rs index c12b8e525a..cf460f73cb 100644 --- a/crates/plugin_runtime/src/lib.rs +++ b/crates/plugin_runtime/src/lib.rs @@ -92,8 +92,6 @@ mod tests { .unwrap(), "eko\n" ); - - // dbg!("{}", runtime.call(&plugin.and_back, 1).await.unwrap()); } .block_on() } diff --git a/crates/plugin_runtime/src/plugin.rs b/crates/plugin_runtime/src/plugin.rs index ac97569a50..d0fff54f87 100644 --- a/crates/plugin_runtime/src/plugin.rs +++ b/crates/plugin_runtime/src/plugin.rs @@ -232,7 +232,6 @@ impl PluginBuilder { /// Initializes a [`Plugin`] from a given compiled Wasm module. /// Both binary (`.wasm`) and text (`.wat`) module formats are supported. pub async fn init>(self, precompiled: bool, module: T) -> Result { - dbg!("initializing plugin"); Plugin::init(precompiled, module.as_ref().to_vec(), self).await } } @@ -302,7 +301,6 @@ impl Plugin { module: Vec, plugin: PluginBuilder, ) -> Result { - dbg!("Initializing new plugin"); // initialize the WebAssembly System Interface context let engine = plugin.engine; let mut linker = plugin.linker; diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs index 511a5bbf6d..3defd81573 100644 --- a/crates/project/src/project.rs +++ b/crates/project/src/project.rs @@ -2041,7 +2041,6 @@ impl Project { } for buffer in buffers_without_language { - dbg!("notified that new language was added"); project.assign_language_to_buffer(&buffer, cx); project.register_buffer_with_language_server(&buffer, cx); dbg!(buffer.read(cx).language().map(|x| x.name())); @@ -2057,7 +2056,6 @@ impl Project { buffer: &ModelHandle, cx: &mut ModelContext, ) -> Option<()> { - dbg!("assigning language to buffer"); // If the buffer has a language, set it and start the language server if we haven't already. let full_path = buffer.read(cx).file()?.full_path(cx); let language = self.languages.select_language(&full_path)?; @@ -2081,7 +2079,6 @@ impl Project { language: Arc, cx: &mut ModelContext, ) { - dbg!(format!("starting lsp for {:?}", language.name())); if !cx .global::() .enable_language_server(Some(&language.name())) @@ -2347,8 +2344,6 @@ impl Project { server_id }); - - dbg!("Done starting lsp"); } // Returns a list of all of the worktrees which no longer have a language server and the root path @@ -3279,7 +3274,6 @@ impl Project { position: T, cx: &mut ModelContext, ) -> Task>> { - // dbg!("getting highlights"); let position = position.to_point_utf16(buffer.read(cx)); self.request_lsp(buffer.clone(), GetDocumentHighlights { position }, cx) } diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs index 58d16e215b..be81944e08 100644 --- a/crates/zed/src/main.rs +++ b/crates/zed/src/main.rs @@ -226,7 +226,6 @@ fn main() { let languages = languages.clone(); |cx| async move { // init_languages.await; - dbg!("not all languages initialized, but starting setting highlighting"); cx.read(|cx| { languages.set_theme(cx.global::().theme.editor.syntax.clone()) }); diff --git a/plugins/json_language/src/lib.rs b/plugins/json_language/src/lib.rs index fe6d268ac9..6a9e128698 100644 --- a/plugins/json_language/src/lib.rs +++ b/plugins/json_language/src/lib.rs @@ -82,7 +82,6 @@ pub fn cached_server_binary(container_dir: PathBuf) -> Option { let last_version_dir = last_version_dir?; let bin_path = last_version_dir.join(BIN_PATH); if bin_path.exists() { - dbg!(&bin_path); Some(bin_path) } else { println!("no binary found"); diff --git a/plugins/test_plugin/src/lib.rs b/plugins/test_plugin/src/lib.rs index 5ea50602f3..769232a26a 100644 --- a/plugins/test_plugin/src/lib.rs +++ b/plugins/test_plugin/src/lib.rs @@ -75,9 +75,8 @@ fn command_async(command: String) -> Option>; #[export] pub fn echo_async(message: String) -> String { - let command = dbg!(format!("echo {}", message)); + let command = format!("echo {}", message); let result = command_async(command); - dbg!(&result); let result = result.expect("Could not run command"); String::from_utf8_lossy(&result).to_string() }