Use a proper settings location for yaml (#17006)
Release Notes: - N/A Co-authored-by: Marshall Bowers <marshall@zed.dev>
This commit is contained in:
parent
7e1eac67ef
commit
98d74f9317
1 changed files with 9 additions and 3 deletions
|
@ -3,11 +3,12 @@ use async_trait::async_trait;
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
use gpui::AsyncAppContext;
|
use gpui::AsyncAppContext;
|
||||||
use language::{
|
use language::{
|
||||||
language_settings::all_language_settings, LanguageServerName, LspAdapter, LspAdapterDelegate,
|
language_settings::AllLanguageSettings, LanguageServerName, LspAdapter, LspAdapterDelegate,
|
||||||
};
|
};
|
||||||
use lsp::LanguageServerBinary;
|
use lsp::LanguageServerBinary;
|
||||||
use node_runtime::NodeRuntime;
|
use node_runtime::NodeRuntime;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
use settings::{Settings, SettingsLocation};
|
||||||
use smol::fs;
|
use smol::fs;
|
||||||
use std::{
|
use std::{
|
||||||
any::Any,
|
any::Any,
|
||||||
|
@ -95,11 +96,16 @@ impl LspAdapter for YamlLspAdapter {
|
||||||
|
|
||||||
async fn workspace_configuration(
|
async fn workspace_configuration(
|
||||||
self: Arc<Self>,
|
self: Arc<Self>,
|
||||||
_: &Arc<dyn LspAdapterDelegate>,
|
delegate: &Arc<dyn LspAdapterDelegate>,
|
||||||
cx: &mut AsyncAppContext,
|
cx: &mut AsyncAppContext,
|
||||||
) -> Result<Value> {
|
) -> Result<Value> {
|
||||||
|
let location = SettingsLocation {
|
||||||
|
worktree_id: delegate.worktree_id() as usize,
|
||||||
|
path: delegate.worktree_root_path(),
|
||||||
|
};
|
||||||
|
|
||||||
let tab_size = cx.update(|cx| {
|
let tab_size = cx.update(|cx| {
|
||||||
all_language_settings(None, cx)
|
AllLanguageSettings::get(Some(location), cx)
|
||||||
.language(Some("YAML"))
|
.language(Some("YAML"))
|
||||||
.tab_size
|
.tab_size
|
||||||
})?;
|
})?;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue