Support yaml-language-server as formatter without lsp settings (#23612)

- Closes: https://github.com/zed-industries/zed/issues/20183
This commit is contained in:
Peter Tripp 2025-01-24 12:51:16 -05:00 committed by GitHub
parent d5c7e0b1e3
commit ed54af337d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 38 additions and 1 deletions

View file

@ -143,7 +143,11 @@ impl LspAdapter for YamlLspAdapter {
.language(Some(location), Some(&"YAML".into()), cx)
.tab_size
})?;
let mut options = serde_json::json!({"[yaml]": {"editor.tabSize": tab_size}});
let mut options = serde_json::json!({
"[yaml]": {"editor.tabSize": tab_size},
"yaml": {"format": {"enable": true}}
});
let project_options = cx.update(|cx| {
language_server_settings(delegate.as_ref(), &Self::SERVER_NAME, cx)