Skip to content

extension_api: Expose hard_tabs in LanguageSettings#52560

Merged
tomhoule merged 1 commit into
zed-industries:mainfrom
tsinis:feat/expose-hard-tabs-to-extensions
Jul 10, 2026
Merged

extension_api: Expose hard_tabs in LanguageSettings#52560
tomhoule merged 1 commit into
zed-industries:mainfrom
tsinis:feat/expose-hard-tabs-to-extensions

Conversation

@tsinis

@tsinis tsinis commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Closes #21822
The issue is closed already, but it was requested to provide the hard_tabs boolean param.

Follow-up to #52175
Reviewed by @maxdeviant (it already bumped the settings path to v0.8.0, so this hard_tabs change only needs 2 files, 2-3 lines of code additions).

Context

Exposes hard_tabs from AllLanguageSettings to the Extension
API's LanguageSettings struct. Currently, only tab_size and preferred_line_length are available to extensions, which prevents language extensions (e.g., Go, C++) from reading the user's hard tabs preference and forwarding it to their language server or formatter (e.g., as rustfmt.hard_tabs or clang-format.UseTab).

Related: #21822 (comment)

How to Review

Small change — follow how tab_size is plumbed through:

  1. WIT definition (language-settings record)
  2. extension_api Rust struct
  3. Host-side bridge conversion

The new field follows the exact same pattern.

Self-Review Checklist

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
    • Compile-time verified via WIT bindings; no runtime behavior change
  • Performance impact has been considered and is acceptable

Release Notes:

  • N/A

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Mar 27, 2026
@zed-codeowner-coordinator
zed-codeowner-coordinator Bot requested review from a team, ConradIrwin, MrSubidubi, nathansobo and smitbarmase and removed request for a team March 27, 2026 08:23
@MrSubidubi MrSubidubi assigned maxdeviant and unassigned ConradIrwin Mar 27, 2026
@MrSubidubi
MrSubidubi requested a review from maxdeviant March 27, 2026 09:01
@zed-industries-bot

zed-industries-bot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor
Messages
📖

This PR includes links to the following GitHub Issues: #21822
If this PR aims to close an issue, please include a Closes #ISSUE line at the top of the PR body.

Generated by 🚫 dangerJS against f726499

@smitbarmase smitbarmase added the area:extensions/infrastructure Feedback for extensions APIs, creation, management, etc label Jun 30, 2026
Add hard_tabs field to LanguageSettings and include it in the
serialization of language settings for extensions.
Reference: zed-industries#21822 (comment)
@tomhoule
tomhoule force-pushed the feat/expose-hard-tabs-to-extensions branch from 1a28993 to f726499 Compare July 10, 2026 11:42
@tomhoule tomhoule assigned tomhoule and unassigned maxdeviant Jul 10, 2026

@tomhoule tomhoule left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition makes sense, and it should be safe. Thank you for the contribution!

@tomhoule
tomhoule added this pull request to the merge queue Jul 10, 2026
Merged via the queue into zed-industries:main with commit c5383ce Jul 10, 2026
35 checks passed
@tsinis
tsinis deleted the feat/expose-hard-tabs-to-extensions branch July 16, 2026 07:50
@tsinis

tsinis commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

The addition makes sense, and it should be safe. Thank you for the contribution!

Thanks a lot for the review and approval, @tomhoule! I'm also wondering - where we can expect zed_extension_api crate update too (so we can reference it safely in Zed extensions)? Last bump was 10+ months ago 🤔 Danke!

@MrSubidubi

Copy link
Copy Markdown
Member

We currently do not have a set date for the next bump, but it might very well be that it will still take some time, since there are other improvements to land and we currently do not have a large enough improvement in the API that would warrant a ship. We originally forked another version for agent provider extensions, but had to postpone these for the time being. Sorry and Gruß!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:extensions/infrastructure Feedback for extensions APIs, creation, management, etc cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose more LanguageSettings to Extensions API

7 participants