Skip to content

Forward preferred_line_length to Dart LSP as dart.lineLength [WIP]#74

Draft
tsinis wants to merge 3 commits intozed-extensions:mainfrom
tsinis:forward-preferred-line-length
Draft

Forward preferred_line_length to Dart LSP as dart.lineLength [WIP]#74
tsinis wants to merge 3 commits intozed-extensions:mainfrom
tsinis:forward-preferred-line-length

Conversation

@tsinis
Copy link
Copy Markdown

@tsinis tsinis commented Mar 25, 2026

Blocked by unreleased zed_extension_api v0.8.0
Related Zed PR
Closes #2

Context

Now that preferred_line_length is exposed in the Extension API's
LanguageSettings (merged in zed-industries/zed#52175), the Dart
extension can forward it to the Dart Analysis Server as dart.lineLength
via workspace/configuration.

This means users no longer need to manually configure
lsp.dart.settings.lineLength — the Dart formatter will automatically
respect the preferred_line_length set in Zed settings.

Explicit lsp.dart.settings overrides still take precedence.

Changes

  • Bumped zed_extension_api to 0.8.0 (git dep until crate is published)
  • Read preferred_line_length from LanguageSettings with graceful
    fallback if unavailable
  • Forward it as dart.lineLength in workspace configuration
  • Merge with existing user LSP settings (user overrides win)
  • Bumped extension version to 0.4.0

tsinis added 2 commits March 25, 2026 08:40
- Bump zed_dart version to 0.4.0 in Cargo.toml
- Update zed_extension_api to use git source and version 0.8.0
- Adjust version in extension.toml to 0.4.0
Forward Zed's preferred_line_length to Dart LSP as dart.lineLength
Read preferred_line_length from LanguageSettings and forward it as
dart.lineLength via workspace/configuration, so the Dart formatter
automatically respects the line length set in Zed settings. Explicit
lsp.dart.settings overrides still take precedence.

Closes zed-extensions#2
@cla-bot cla-bot bot added the cla-signed label Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant