vscode-format-code-action
vscode-format-code-action copied to clipboard
Please check 'CodeActionContext.only' to only return requested code actions.
Version: 0.1.0
Settings:
{
"editor.codeActionsOnSave": [
"source.organizeimports", // put anything before format
"source.formatDocument",
"source.fixAll.eslint"
]
}
Output panel:
[exthost] [warning] rohit-gohri.format-code-action - Code actions of kind 'source.fixAll.format'
requested but returned code action is of kind 'source.formatModified'. Code action will be dropped.
Please check 'CodeActionContext.only' to only return requested code actions.
[exthost] [warning] rohit-gohri.format-code-action - Code actions of kind 'source.formatDocument'
requested but returned code action is of kind 'source.formatModified'. Code action will be dropped.
Please check 'CodeActionContext.only' to only return requested code actions.
Does anyone know what the underlying cause is, or if there's a work-around? This extension had been working for me, then stopped with this error presenting in the log any time I save.
Edit: In my case, the behavior went away when I restarted the ESLint server (command palette: ESLint: Restart ESLint Server).
I'm just having this issue. For me, it starts formatting back and forth between prettier formatting and eslint fixing. I'm only hitting save once. The extension has been working fine for me with the same settings for years, but suddenly this has started happening.
Does anyone know how to fix this or workaround it? Or wheter there's any alternative?

Actually, I've found that this particular issue may be caused by vscode itself. Here's the issue: https://github.com/microsoft/vscode/issues/165326
For me, it starts formatting back and forth between prettier formatting and eslint fixing. I'm only hitting save once.
Are you using codeActionsOnSave as an array or an object?
I'm using it as an array:
"editor.codeActionsOnSave": ["source.formatDocument", "source.fixAll.eslint"],
"editor.defaultFormatter": "esbenp.prettier-vscode"
After I rolled back to the previous version of vscode (v1.72,2) it's working fine again.
I'm just having this issue. For me, it starts formatting back and forth between prettier formatting and eslint fixing. I'm only hitting save once. The extension has been working fine for me with the same settings for years, but suddenly this has started happening.
Does anyone know how to fix this or workaround it? Or wheter there's any alternative?
![]()
![]()
i am now stuck here, been digging for anything on the topic. thanks for the references.
Please see this comment - https://github.com/rohit-gohri/vscode-format-code-action/issues/13#issuecomment-1307403778
If it's still not solved then please open a new issue, this problem is not related to the original issue.