Better pass prettier options
This commit is contained in:
parent
e2056756ef
commit
2a5b9b635b
11 changed files with 55 additions and 34 deletions
|
@ -98,7 +98,7 @@ impl LspAdapter for CssLspAdapter {
|
|||
}
|
||||
|
||||
fn enabled_formatters(&self) -> Vec<BundledFormatter> {
|
||||
vec![BundledFormatter::prettier()]
|
||||
vec![BundledFormatter::prettier("css")]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ impl LspAdapter for HtmlLspAdapter {
|
|||
}
|
||||
|
||||
fn enabled_formatters(&self) -> Vec<BundledFormatter> {
|
||||
vec![BundledFormatter::prettier()]
|
||||
vec![BundledFormatter::prettier("html")]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ impl LspAdapter for JsonLspAdapter {
|
|||
}
|
||||
|
||||
fn enabled_formatters(&self) -> Vec<BundledFormatter> {
|
||||
vec![BundledFormatter::prettier()]
|
||||
vec![BundledFormatter::prettier("json")]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ use anyhow::{anyhow, Result};
|
|||
use async_trait::async_trait;
|
||||
use collections::HashMap;
|
||||
|
||||
use language::{BundledFormatter, LanguageServerName, LspAdapter, LspAdapterDelegate};
|
||||
use language::{LanguageServerName, LspAdapter, LspAdapterDelegate};
|
||||
use lsp::LanguageServerBinary;
|
||||
use node_runtime::NodeRuntime;
|
||||
|
||||
|
@ -100,13 +100,10 @@ impl LspAdapter for IntelephenseLspAdapter {
|
|||
async fn initialization_options(&self) -> Option<serde_json::Value> {
|
||||
None
|
||||
}
|
||||
|
||||
async fn language_ids(&self) -> HashMap<String, String> {
|
||||
HashMap::from_iter([("PHP".into(), "php".into())])
|
||||
}
|
||||
|
||||
fn enabled_formatters(&self) -> Vec<BundledFormatter> {
|
||||
vec![BundledFormatter::prettier()]
|
||||
}
|
||||
}
|
||||
|
||||
async fn get_cached_server_binary(
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use anyhow::{anyhow, Result};
|
||||
use async_trait::async_trait;
|
||||
use futures::StreamExt;
|
||||
use language::{BundledFormatter, LanguageServerName, LspAdapter, LspAdapterDelegate};
|
||||
use language::{LanguageServerName, LspAdapter, LspAdapterDelegate};
|
||||
use lsp::LanguageServerBinary;
|
||||
use node_runtime::NodeRuntime;
|
||||
use serde_json::json;
|
||||
|
@ -95,10 +95,6 @@ impl LspAdapter for SvelteLspAdapter {
|
|||
"provideFormatter": true
|
||||
}))
|
||||
}
|
||||
|
||||
fn enabled_formatters(&self) -> Vec<BundledFormatter> {
|
||||
vec![BundledFormatter::prettier()]
|
||||
}
|
||||
}
|
||||
|
||||
async fn get_cached_server_binary(
|
||||
|
|
|
@ -163,7 +163,7 @@ impl LspAdapter for TypeScriptLspAdapter {
|
|||
}
|
||||
|
||||
fn enabled_formatters(&self) -> Vec<BundledFormatter> {
|
||||
vec![BundledFormatter::prettier()]
|
||||
vec![BundledFormatter::prettier("typescript")]
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -315,7 +315,7 @@ impl LspAdapter for EsLintLspAdapter {
|
|||
}
|
||||
|
||||
fn enabled_formatters(&self) -> Vec<BundledFormatter> {
|
||||
vec![BundledFormatter::prettier()]
|
||||
vec![BundledFormatter::prettier("babel")]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ impl LspAdapter for YamlLspAdapter {
|
|||
}
|
||||
|
||||
fn enabled_formatters(&self) -> Vec<BundledFormatter> {
|
||||
vec![BundledFormatter::prettier()]
|
||||
vec![BundledFormatter::prettier("yaml")]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue