fix(oxc): allow oxfmt and oxlint to run in single-file mode - #4509
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
oxlintandoxfmtservers 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 = truefrom thebiomeconfig or there was no single-file support at the time (I only started usingoxfmttoday). 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 = truefrom theoxlintandoxfmtconfigs.I've tested
oxfmtin single-file mode on a HTML, JS, TS, and markdown file. I've testedoxlintin single-mode on a JS file.