Skip to content

refactor(cli): generate Zed language settings from a language list - #2294

Merged
fengmk2 merged 1 commit into
voidzero-dev:mainfrom
jong-kyung:refactor/zed-language-settings
Aug 2, 2026
Merged

refactor(cli): generate Zed language settings from a language list#2294
fengmk2 merged 1 commit into
voidzero-dev:mainfrom
jong-kyung:refactor/zed-language-settings

Conversation

@jong-kyung

@jong-kyung jong-kyung commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

ZED_SETTINGS.languages in packages/cli/src/utils/editor.ts listed 17 per-language blocks that were verbatim-identical except for one key, so this PR replaces them with a language-name array mapped through Object.fromEntries (88 lines down to 30).

  • The only per-language difference (code_action: 'source.fixAll.oxc' on JavaScript) is now an explicit conditional spread instead of being hidden inside a wall of identical blocks.
  • Adding a newly supported language becomes a one-line array entry instead of a copy-pasted block.

Behavior

No behavior change. Object.fromEntries preserves array order, so the generated .zed/settings.json is byte-identical, and ZED_SETTINGS is consumed as Record<string, unknown> so the weaker literal typing has no effect.

Replace 17 verbatim-identical per-language blocks in ZED_SETTINGS.languages
with a language-name array mapped through Object.fromEntries. Only the
JavaScript entry differs (code_action: source.fixAll.oxc), now expressed as
a conditional spread. Generated .zed/settings.json output is byte-identical.
@netlify

netlify Bot commented Aug 2, 2026

Copy link
Copy Markdown

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 39b47af
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a6f20a5c172060009970681

@jong-kyung jong-kyung self-assigned this Aug 2, 2026
@jong-kyung
jong-kyung marked this pull request as ready for review August 2, 2026 10:49
@jong-kyung
jong-kyung requested review from fengmk2 and naokihaba August 2, 2026 10:49
@naokihaba

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 39b47af360

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@naokihaba naokihaba left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I considered if language-specific overrides might add overhead later, but since there's only one exception, this abstraction seems fine. It cleans up the duplication and makes shared updates much safer.

@fengmk2
fengmk2 merged commit 40a6273 into voidzero-dev:main Aug 2, 2026
44 checks passed
@jong-kyung
jong-kyung deleted the refactor/zed-language-settings branch August 2, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants