Properly support prettier plugins

This commit is contained in:
Kirill Bulatov 2023-09-22 23:49:03 +03:00
parent afee29ad3f
commit 8a807102a6
8 changed files with 100 additions and 33 deletions

View file

@ -338,10 +338,6 @@ pub trait LspAdapter: 'static + Send + Sync {
Default::default()
}
// TODO kb enable this for
// markdown somehow?
// tailwind (needs a css plugin, there are 2 of them)
// svelte (needs a plugin)
fn enabled_formatters(&self) -> Vec<BundledFormatter> {
Vec::new()
}
@ -350,15 +346,15 @@ pub trait LspAdapter: 'static + Send + Sync {
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum BundledFormatter {
Prettier {
parser_name: &'static str,
plugin_names: Vec<String>,
parser_name: Option<&'static str>,
plugin_names: Vec<&'static str>,
},
}
impl BundledFormatter {
pub fn prettier(parser_name: &'static str) -> Self {
Self::Prettier {
parser_name,
parser_name: Some(parser_name),
plugin_names: Vec::new(),
}
}