Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

extension_api: Expose preferred_line_length in LanguageSettings (#52175)

Roman Cinis7ccef1dd89fd
diff --git a/crates/extension_api/src/settings.rs b/crates/extension_api/src/settings.rs
index a133a8027a4..bb9f2e20b23 100644
--- a/crates/extension_api/src/settings.rs
+++ b/crates/extension_api/src/settings.rs
@@ -1,6 +1,6 @@
//! Provides access to Zed settings.
-#[path = "../wit/since_v0.2.0/settings.rs"]
+#[path = "../wit/since_v0.8.0/settings.rs"]
mod types;
use crate::{Project, Result, SettingsLocation, Worktree, wit};
diff --git a/crates/extension_api/wit/since_v0.8.0/settings.rs b/crates/extension_api/wit/since_v0.8.0/settings.rs
index 19e28c1ba95..7c77dc79baf 100644
--- a/crates/extension_api/wit/since_v0.8.0/settings.rs
+++ b/crates/extension_api/wit/since_v0.8.0/settings.rs
@@ -6,6 +6,8 @@ use std::{collections::HashMap, num::NonZeroU32};
pub struct LanguageSettings {
/// How many columns a tab should occupy.
pub tab_size: NonZeroU32,
+ /// The preferred line length (column at which to wrap).
+ pub preferred_line_length: u32,
}
/// The settings for a particular language server.
diff --git a/crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs b/crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs
index d7cf29ad0a3..324a572f40c 100644
--- a/crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs
+++ b/crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs
@@ -941,6 +941,7 @@ impl ExtensionImports for WasmState {
);
Ok(serde_json::to_string(&settings::LanguageSettings {
tab_size: settings.tab_size,
+ preferred_line_length: settings.preferred_line_length,
})?)
}
"lsp" => {