Simplify language server startup (#6449)

These are just some small refactorings of our language-server-starting
code, motivated by another change that I decided to bail on:
https://github.com/zed-industries/zed/pull/6448.
This commit is contained in:
Max Brunsfeld 2024-01-24 17:36:50 -08:00 committed by GitHub
parent 90c1d8f734
commit 6ed7cc7833
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 91 additions and 117 deletions

View file

@ -38,7 +38,7 @@ impl JsonLspAdapter {
#[async_trait]
impl LspAdapter for JsonLspAdapter {
async fn name(&self) -> LanguageServerName {
fn name(&self) -> LanguageServerName {
LanguageServerName("json-language-server".into())
}
@ -96,7 +96,7 @@ impl LspAdapter for JsonLspAdapter {
get_cached_server_binary(container_dir, &*self.node).await
}
async fn initialization_options(&self) -> Option<serde_json::Value> {
fn initialization_options(&self) -> Option<serde_json::Value> {
Some(json!({
"provideFormatter": true
}))
@ -140,7 +140,7 @@ impl LspAdapter for JsonLspAdapter {
})
}
async fn language_ids(&self) -> HashMap<String, String> {
fn language_ids(&self) -> HashMap<String, String> {
[("JSON".into(), "jsonc".into())].into_iter().collect()
}
}