From f726499aa56b0b35d087d7fc25e7b8c11f0238b6 Mon Sep 17 00:00:00 2001 From: Roman Cinis <52065414+tsinis@users.noreply.github.com> Date: Fri, 27 Mar 2026 09:10:10 +0100 Subject: [PATCH] extension_api: Expose hard_tabs in LanguageSettings Add hard_tabs field to LanguageSettings and include it in the serialization of language settings for extensions. Reference: https://github.com/zed-industries/zed/issues/21822#issuecomment-4139809956 --- crates/extension_api/wit/since_v0.8.0/settings.rs | 2 ++ crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs | 1 + 2 files changed, 3 insertions(+) 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 7c77dc79baf7ab..0f8d2c52b2cf81 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 15e5ff94062094..25cd0c2d368274 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, })?) }