Skip to content

Commit 4cb342c

Browse files
fix: use fmt.configPath for Zed oxfmt settings (#1687)
According to the [Zed OXC extension example](https://github.com/oxc-project/oxc-zed/blob/main/examples/oxfmt/.zed/settings.json), the `configPath` should be `fmt.configPath` instead, and I verified it myself. Co-authored-by: MK (fengmk2) <fengmk2@gmail.com>
1 parent a29e478 commit 4cb342c

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

docs/guide/ide-integration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ You can also manually set up the Zed config:
7171
"oxfmt": {
7272
"initialization_options": {
7373
"settings": {
74-
"configPath": "./vite.config.ts",
74+
"fmt.configPath": "./vite.config.ts",
7575
"run": "onSave"
7676
}
7777
}
@@ -98,4 +98,4 @@ You can also manually set up the Zed config:
9898
}
9999
```
100100

101-
Setting `oxfmt.configPath` to `./vite.config.ts` keeps editor format-on-save aligned with the `fmt` block in your Vite+ config. The full generated config covers additional languages (CSS, HTML, JSON, Markdown, etc.) — run `vp create` or `vp migrate` to get the complete file written automatically.
101+
Setting `oxfmt.fmt.configPath` to `./vite.config.ts` keeps editor format-on-save aligned with the `fmt` block in your Vite+ config. The full generated config covers additional languages (CSS, HTML, JSON, Markdown, etc.) — run `vp create` or `vp migrate` to get the complete file written automatically.

packages/cli/src/utils/__tests__/editor.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,14 @@ describe('writeEditorConfigs', () => {
250250
oxfmt?: {
251251
initialization_options?: {
252252
settings?: {
253-
configPath?: string;
253+
'fmt.configPath'?: string;
254254
};
255255
};
256256
};
257257
};
258258
};
259259

260-
expect(settings.lsp?.oxfmt?.initialization_options?.settings?.configPath).toBe(
260+
expect(settings.lsp?.oxfmt?.initialization_options?.settings?.['fmt.configPath']).toBe(
261261
'./vite.config.ts',
262262
);
263263
});

packages/cli/src/utils/editor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const ZED_SETTINGS = {
4646
oxfmt: {
4747
initialization_options: {
4848
settings: {
49-
configPath: './vite.config.ts',
49+
'fmt.configPath': './vite.config.ts',
5050
run: 'onSave',
5151
},
5252
},

0 commit comments

Comments
 (0)