diff --git a/crates/prettier/src/prettier.rs b/crates/prettier/src/prettier.rs index b73cd8a1b0..cb9d32d0b0 100644 --- a/crates/prettier/src/prettier.rs +++ b/crates/prettier/src/prettier.rs @@ -64,6 +64,12 @@ impl Prettier { .components() .take_while(|component| component.as_os_str().to_string_lossy() != "node_modules") .collect::(); + if path_to_check != locate_from { + log::debug!( + "Skipping prettier location for path {path_to_check:?} that is inside node_modules" + ); + return Ok(ControlFlow::Break(())); + } let path_to_check_metadata = fs .metadata(&path_to_check) .await diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs index 40736b97c2..468659e5b9 100644 --- a/crates/project/src/project.rs +++ b/crates/project/src/project.rs @@ -173,8 +173,7 @@ pub struct Project { struct DefaultPrettier { instance: Option, Arc>>>>, installation_process: Option>>>>, - // TODO kb uncomment - // #[cfg(not(any(test, feature = "test-support")))] + #[cfg(not(any(test, feature = "test-support")))] installed_plugins: HashSet<&'static str>, } @@ -8540,18 +8539,17 @@ impl Project { } } - // TODO kb uncomment - // #[cfg(any(test, feature = "test-support"))] - // fn install_default_formatters( - // &mut self, - // _worktree: Option, - // _new_language: &Language, - // _language_settings: &LanguageSettings, - // _cx: &mut ModelContext, - // ) { - // } + #[cfg(any(test, feature = "test-support"))] + fn install_default_formatters( + &mut self, + _worktree: Option, + _new_language: &Language, + _language_settings: &LanguageSettings, + _cx: &mut ModelContext, + ) { + } - // #[cfg(not(any(test, feature = "test-support")))] + #[cfg(not(any(test, feature = "test-support")))] fn install_default_formatters( &mut self, worktree: Option, @@ -8714,8 +8712,7 @@ fn start_default_prettier( .get_or_insert_with(|| DefaultPrettier { instance: None, installation_process: None, - // TODO kb uncomment - // #[cfg(not(any(test, feature = "test-support")))] + #[cfg(not(any(test, feature = "test-support")))] installed_plugins: HashSet::default(), }) .instance = Some(new_default_prettier.clone()); @@ -8797,8 +8794,7 @@ fn register_new_prettier( } } -// TODO kb uncomment -// #[cfg(not(any(test, feature = "test-support")))] +#[cfg(not(any(test, feature = "test-support")))] async fn install_default_prettier( plugins_to_install: HashSet<&'static str>, node: Arc,