Skip to content

feat: Make OxcFixAllAction work when triggered from project view#177

Merged
nrayburn-tech merged 4 commits intooxc-project:mainfrom
InSyncWithFoo:main
May 11, 2025
Merged

feat: Make OxcFixAllAction work when triggered from project view#177
nrayburn-tech merged 4 commits intooxc-project:mainfrom
InSyncWithFoo:main

Conversation

@InSyncWithFoo
Copy link
Copy Markdown
Contributor

Resolves #170 and reverts #173.

I haven't tested it, but it should work.

@nrayburn-tech
Copy link
Copy Markdown
Collaborator

Thanks for the PR. There is a custom workspace command that I think should probably be used here instead of this approach, but I'm not entirely sure.

@Sysix we have a scenario where we want to apply the fixes to a file that is not opened within the editor. We do this by right clicking the file name and triggering an action on it. Does the oxc.fixAll custom workspace command make sense to use here? Or is there a different approach we should use when trying to fix a file that isn't open in the editor?

@Sysix
Copy link
Copy Markdown
Member

Sysix commented May 5, 2025

The command expects that the file is still open. The server could lint them from file system, but is just skipping it currently:
https://github.com/oxc-project/oxc/blob/fec160476cbef725d3bef9475f5810d7fa579716/crates/oxc_language_server/src/worker.rs#L198-L200

Or is there a different approach we should use when trying to fix a file that isn't open in the editor?

I expect every approach will suffer from this problem. Here the same problem with code actions:
https://github.com/oxc-project/oxc/blob/fec160476cbef725d3bef9475f5810d7fa579716/crates/oxc_language_server/src/worker.rs#L164-L166

graphite-app bot pushed a commit to oxc-project/oxc that referenced this pull request May 6, 2025
…iles (#10815)

Related oxc-project/oxc-intellij-plugin#177

When the client request code actions or commands for a file. This file must not be open to be requested.
In the main, we are just looking into our `diagnostics_map`, which will be filled only on open/change/close of the text document.

When the client request now a code action or command for a file, we will lint them only (if not already done) and avoid filling the `diagnostic_map`.
@nrayburn-tech
Copy link
Copy Markdown
Collaborator

This will only work once oxc-project/oxc#10815 is released. Once there's a version of Oxlint out that supports that, this can be merged and released.

@nrayburn-tech
Copy link
Copy Markdown
Collaborator

Oh, 0.16.10 is out with that PR already. I'll merge this in and release a version sometime this weekend.

@nrayburn-tech nrayburn-tech merged commit 6fdf7c2 into oxc-project:main May 11, 2025
5 checks passed
Boshen pushed a commit to oxc-project/oxc-vscode that referenced this pull request Feb 4, 2026
…iles (#10815)

Related oxc-project/oxc-intellij-plugin#177

When the client request code actions or commands for a file. This file must not be open to be requested.
In the main, we are just looking into our `diagnostics_map`, which will be filled only on open/change/close of the text document.

When the client request now a code action or command for a file, we will lint them only (if not already done) and avoid filling the `diagnostic_map`.
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.

Context menu Apply Oxc Quick Fixes doesn't do anything

3 participants