Skip to content

extension_api: Expose preferred_line_length in LanguageSettings - #52175

Merged
maxdeviant merged 2 commits into
zed-industries:mainfrom
tsinis:feat/expose-preferred-line-length-to-extensions
Mar 24, 2026
Merged

extension_api: Expose preferred_line_length in LanguageSettings#52175
maxdeviant merged 2 commits into
zed-industries:mainfrom
tsinis:feat/expose-preferred-line-length-to-extensions

Conversation

@tsinis

@tsinis tsinis commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Closes #21822

Context

Exposes preferred_line_length from AllLanguageSettings to the Extension
API's LanguageSettings struct. Currently only tab_size is available to
extensions, which prevents language extensions (e.g. Dart) from reading the
user's preferred line length and forwarding it to their language server
(e.g. as dart.lineLength).

Related: zed-extensions/dart#2

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 23, 2026
@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Mar 23, 2026
@zed-codeowner-coordinator
zed-codeowner-coordinator Bot requested review from a team, bennetbo and nathansobo and removed request for a team March 23, 2026 08:44
@zed-industries-bot

zed-industries-bot commented Mar 23, 2026

Copy link
Copy Markdown
Contributor
Messages
📖

This PR includes links to the following GitHub Issues: #zed-extensions/dart#2
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 40e6027

@tsinis tsinis changed the title extension_api: expose preferred_line_length in LanguageSettings extension_api: Expose preferred_line_length in LanguageSettings Mar 23, 2026
Comment thread crates/extension_api/wit/since_v0.0.6/settings.rs Outdated
@bennetbo bennetbo assigned maxdeviant and unassigned nathansobo Mar 24, 2026
This change removes the `preferred_line_length` field from the
`LanguageSettings` struct across multiple versions to streamline
settings management.
@tsinis
tsinis requested a review from maxdeviant March 24, 2026 20:18

@maxdeviant maxdeviant left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

@maxdeviant
maxdeviant merged commit 7ccef1d into zed-industries:main Mar 24, 2026
32 checks passed
@tsinis
tsinis deleted the feat/expose-preferred-line-length-to-extensions branch March 25, 2026 06:16
piper-of-dawn pushed a commit to piper-of-dawn/zed that referenced this pull request Apr 25, 2026
…industries#52175)

Closes zed-industries#21822

## Context

Exposes `preferred_line_length` from `AllLanguageSettings` to the
Extension
API's `LanguageSettings` struct. Currently only `tab_size` is available
to
extensions, which prevents language extensions (e.g. Dart) from reading
the
user's preferred line length and forwarding it to their language server
(e.g. as `dart.lineLength`).

Related: zed-extensions/dart#2

## 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

<!-- Check before requesting review: -->
- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
  - Compile-time verified via WIT bindings; no runtime behavior change
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
Zenor27 pushed a commit to Zenor27/zed that referenced this pull request Jul 4, 2026
…industries#52175)

Closes zed-industries#21822

## Context

Exposes `preferred_line_length` from `AllLanguageSettings` to the
Extension
API's `LanguageSettings` struct. Currently only `tab_size` is available
to
extensions, which prevents language extensions (e.g. Dart) from reading
the
user's preferred line length and forwarding it to their language server
(e.g. as `dart.lineLength`).

Related: zed-extensions/dart#2

## 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

<!-- Check before requesting review: -->
- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
  - Compile-time verified via WIT bindings; no runtime behavior change
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
pixel365 pushed a commit to pixel365/zed that referenced this pull request Jul 10, 2026
…2560)

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

Follow-up to zed-industries#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:
zed-industries#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

<!-- Check before requesting review: -->
- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
  - Compile-time verified via WIT bindings; no runtime behavior change
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
…industries#52175)

Closes zed-industries#21822

## Context

Exposes `preferred_line_length` from `AllLanguageSettings` to the
Extension
API's `LanguageSettings` struct. Currently only `tab_size` is available
to
extensions, which prevents language extensions (e.g. Dart) from reading
the
user's preferred line length and forwarding it to their language server
(e.g. as `dart.lineLength`).

Related: zed-extensions/dart#2

## 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

<!-- Check before requesting review: -->
- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
  - Compile-time verified via WIT bindings; no runtime behavior change
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
…2560)

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

Follow-up to zed-industries#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:
zed-industries#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

<!-- Check before requesting review: -->
- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
  - Compile-time verified via WIT bindings; no runtime behavior change
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
playdohface pushed a commit to playdohface/zed that referenced this pull request Aug 29, 2026
…2560)

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

Follow-up to zed-industries#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:
zed-industries#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

<!-- Check before requesting review: -->
- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
  - Compile-time verified via WIT bindings; no runtime behavior change
- [x] Performance impact has been considered and is acceptable

Release Notes:

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

Labels

cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose more LanguageSettings to Extensions API

4 participants