Use a proper settings location for yaml (#17006)
Some checks are pending
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run

Release Notes:

- N/A

Co-authored-by: Marshall Bowers <marshall@zed.dev>
This commit is contained in:
Kirill Bulatov 2024-08-28 18:00:38 +03:00 committed by GitHub
parent 7e1eac67ef
commit 98d74f9317
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,11 +3,12 @@ use async_trait::async_trait;
use futures::StreamExt;
use gpui::AsyncAppContext;
use language::{
language_settings::all_language_settings, LanguageServerName, LspAdapter, LspAdapterDelegate,
language_settings::AllLanguageSettings, LanguageServerName, LspAdapter, LspAdapterDelegate,
};
use lsp::LanguageServerBinary;
use node_runtime::NodeRuntime;
use serde_json::Value;
use settings::{Settings, SettingsLocation};
use smol::fs;
use std::{
any::Any,
@ -95,11 +96,16 @@ impl LspAdapter for YamlLspAdapter {
async fn workspace_configuration(
self: Arc<Self>,
_: &Arc<dyn LspAdapterDelegate>,
delegate: &Arc<dyn LspAdapterDelegate>,
cx: &mut AsyncAppContext,
) -> Result<Value> {
let location = SettingsLocation {
worktree_id: delegate.worktree_id() as usize,
path: delegate.worktree_root_path(),
};
let tab_size = cx.update(|cx| {
all_language_settings(None, cx)
AllLanguageSettings::get(Some(location), cx)
.language(Some("YAML"))
.tab_size
})?;