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 hard_tabs in LanguageSettings (#52560)

Roman Cinisc5383ce5d41d
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 7c77dc79baf..0f8d2c52b2c 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,
+ /// Whether to indent with hard tabs (true) or spaces (false).
+ pub hard_tabs: bool,
/// The preferred line length (column at which to wrap).
pub preferred_line_length: u32,
}
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 15e5ff94062..25cd0c2d368 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
@@ -968,6 +968,7 @@ impl ExtensionImports for WasmState {
);
Ok(serde_json::to_string(&settings::LanguageSettings {
tab_size: settings.tab_size,
+ hard_tabs: settings.hard_tabs,
preferred_line_length: settings.preferred_line_length,
})?)
}