Make language adapters able to require certain bundled formatters
This commit is contained in:
parent
4f956d71e2
commit
12ea12e4e7
11 changed files with 80 additions and 20 deletions
|
@ -4,7 +4,9 @@ use collections::HashMap;
|
|||
use feature_flags::FeatureFlagAppExt;
|
||||
use futures::{future::BoxFuture, FutureExt, StreamExt};
|
||||
use gpui::AppContext;
|
||||
use language::{LanguageRegistry, LanguageServerName, LspAdapter, LspAdapterDelegate};
|
||||
use language::{
|
||||
BundledFormatter, LanguageRegistry, LanguageServerName, LspAdapter, LspAdapterDelegate,
|
||||
};
|
||||
use lsp::LanguageServerBinary;
|
||||
use node_runtime::NodeRuntime;
|
||||
use serde_json::json;
|
||||
|
@ -144,6 +146,10 @@ impl LspAdapter for JsonLspAdapter {
|
|||
async fn language_ids(&self) -> HashMap<String, String> {
|
||||
[("JSON".into(), "jsonc".into())].into_iter().collect()
|
||||
}
|
||||
|
||||
fn enabled_formatters(&self) -> Vec<BundledFormatter> {
|
||||
vec![BundledFormatter::prettier()]
|
||||
}
|
||||
}
|
||||
|
||||
async fn get_cached_server_binary(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue