Skip to content

fix(oxc): allow oxfmt and oxlint to run in single-file mode - #4509

Merged
justinmk merged 1 commit into
neovim:masterfrom
marcuscaisey:oxc-single-file
Aug 19, 2026
Merged

fix(oxc): allow oxfmt and oxlint to run in single-file mode#4509
justinmk merged 1 commit into
neovim:masterfrom
marcuscaisey:oxc-single-file

Conversation

@marcuscaisey

Copy link
Copy Markdown
Contributor

Problem

The oxlint and oxfmt servers don't get started if a root directory can't be determined.

I think the change which added these servers (originally they were both in oxc-language-server)
#3586 either cargo culted single_file_support = true from the biome config or there was no single-file support at the time (I only started using oxfmt today). Either way, single-file mode is explictly supported now: https://github.com/oxc-project/oxc/blob/f7be7cc5d3011203da2d824be18d6980adc786ba/crates/oxc_language_server/src/backend.rs?plain=1#L141.

Solution

Remove workspace_required = true from the oxlint and oxfmt configs.

I've tested oxfmt in single-file mode on a HTML, JS, TS, and markdown file. I've tested oxlint in single-mode on a JS file.

Problem:
The `oxlint` and `oxfmt` servers don't get started if a root directory
can't be determined.

I think the change which added these servers (originally they were both
in `oxc-language-server`)
neovim#3586 either cargo culted
`single_file_support = true` from the `biome` config or there was no
single-file support at the time (I only started using `oxfmt` today).
Either way, single-file mode is explictly supported now:
https://github.com/oxc-project/oxc/blob/f7be7cc5d3011203da2d824be18d6980adc786ba/crates/oxc_language_server/src/backend.rs?plain=1#L141.

Solution:
Remove `workspace_required = true` from the `oxlint` and `oxfmt`
configs. I've tested `oxfmt` in single-file mode on a HTML, JS, TS, and
markdown file. I've tested `oxlint` in single-mode on a JS file.
@justinmk
justinmk merged commit fa98da4 into neovim:master Aug 19, 2026
5 checks passed
@marcuscaisey
marcuscaisey deleted the oxc-single-file branch August 19, 2026 19:50
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.

2 participants