Better pass prettier options

This commit is contained in:
Kirill Bulatov 2023-09-18 18:08:55 +03:00
parent e2056756ef
commit 2a5b9b635b
11 changed files with 55 additions and 34 deletions

View file

@ -341,6 +341,7 @@ pub trait LspAdapter: 'static + Send + Sync {
// 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()
}
@ -348,12 +349,16 @@ pub trait LspAdapter: 'static + Send + Sync {
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum BundledFormatter {
Prettier { plugin_names: Vec<String> },
Prettier {
parser_name: &'static str,
plugin_names: Vec<String>,
},
}
impl BundledFormatter {
pub fn prettier() -> Self {
pub fn prettier(parser_name: &'static str) -> Self {
Self::Prettier {
parser_name,
plugin_names: Vec::new(),
}
}