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:
parent
90c1d8f734
commit
6ed7cc7833
20 changed files with 91 additions and 117 deletions
|
@ -34,7 +34,7 @@ impl TailwindLspAdapter {
|
|||
|
||||
#[async_trait]
|
||||
impl LspAdapter for TailwindLspAdapter {
|
||||
async fn name(&self) -> LanguageServerName {
|
||||
fn name(&self) -> LanguageServerName {
|
||||
LanguageServerName("tailwindcss-language-server".into())
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ impl LspAdapter for TailwindLspAdapter {
|
|||
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,
|
||||
"userLanguages": {
|
||||
|
@ -112,7 +112,7 @@ impl LspAdapter for TailwindLspAdapter {
|
|||
})
|
||||
}
|
||||
|
||||
async fn language_ids(&self) -> HashMap<String, String> {
|
||||
fn language_ids(&self) -> HashMap<String, String> {
|
||||
HashMap::from_iter([
|
||||
("HTML".to_string(), "html".to_string()),
|
||||
("CSS".to_string(), "css".to_string()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue