Rework prettier tests

Do not infuse `FakeNodeRuntime` with prettier exceptions, rather keep
the default formatter installation method as no-op.
This commit is contained in:
Kirill Bulatov 2023-10-24 14:25:46 +02:00
parent ff497810dd
commit e9ce935991
5 changed files with 16 additions and 121 deletions

View file

@ -86,6 +86,8 @@ use util::{
};
pub use fs::*;
#[cfg(any(test, feature = "test-support"))]
pub use prettier::FORMAT_SUFFIX as TEST_PRETTIER_FORMAT_SUFFIX;
pub use worktree::*;
pub trait Item {
@ -833,16 +835,6 @@ impl Project {
project
}
/// Enables a prettier mock that avoids interacting with node runtime, prettier LSP wrapper, or any real file changes.
/// Instead, if appends the suffix to every input, this suffix is returned by this method.
#[cfg(any(test, feature = "test-support"))]
pub fn enable_test_prettier(&mut self, plugins: &[&'static str]) -> &'static str {
self.node = Some(node_runtime::FakeNodeRuntime::with_prettier_support(
plugins,
));
Prettier::FORMAT_SUFFIX
}
fn on_settings_changed(&mut self, cx: &mut ModelContext<Self>) {
let mut language_servers_to_start = Vec::new();
let mut language_formatters_to_check = Vec::new();