elixir: Respect LSP settings for elixir-ls (#11302)

This PR updates the Elixir extension to respect the LSP settings for
`elixir-ls`:

```json
"lsp": {
  "elixir-ls": {
    "settings": {
      "dialyzerEnabled": false
    }
  }
}
```

```
Received workspace/didChangeConfiguration
Received client configuration via workspace/didChangeConfiguration
%{"dialyzerEnabled" => false}
Loaded DETS databases in 33ms
Loaded DETS databases in 10ms
Compiling 65 files (.ex)
```

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-05-02 11:16:09 -04:00 committed by GitHub
parent 98ea5e172e
commit 8b284331a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 33 additions and 1 deletions

View file

@ -102,6 +102,23 @@ impl zed::Extension for ElixirExtension {
_ => Ok(None),
}
}
fn language_server_workspace_configuration(
&mut self,
language_server_id: &LanguageServerId,
worktree: &zed::Worktree,
) -> Result<Option<serde_json::Value>> {
match language_server_id.as_ref() {
ElixirLs::LANGUAGE_SERVER_ID => {
if let Some(elixir_ls) = self.elixir_ls.as_mut() {
return elixir_ls.language_server_workspace_configuration(worktree);
}
}
_ => (),
}
Ok(None)
}
}
zed::register_extension!(ElixirExtension);