From fa7d66046b8ddd91b00ba525a3592b61345140cc Mon Sep 17 00:00:00 2001 From: kevmoo Date: Fri, 1 May 2026 14:04:08 -0700 Subject: [PATCH] docs: add recommended configuration section to README - Document how to enable organize imports and fix all on save - Provide key binding example for sort members --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index ea316ce..0cc40b1 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,43 @@ A [Dart](https://dart.dev/) extension for [Zed](https://zed.dev). +## Recommended Configuration + +To make the most of the Dart LSP in Zed, you can configure it to automatically organize imports and apply fixes on format. + +### Settings (`settings.json`) + +Add the following to your `settings.json` to enable productivity features like organizing imports on save: + +```json +{ + "languages": { + "Dart": { + "format_on_save": "on", + "code_actions_on_format": { + "source.organizeImports": true, + "source.fixAll": true + } + } + } +} +``` + +### Key Bindings (`keymap.json`) + +You can bind specific LSP actions to keyboard shortcuts. For example, to manually trigger "Sort Members": + +```json +[ + { + "context": "Editor && mode == full && language == Dart", + "bindings": { + "ctrl-alt-s": ["editor:apply_code_action", "source.sortMembers"] + } + } +] +``` + ## Documentation See: