ESLint server only looks at first entry in context.only
array sent along with textDocument/codeAction
#1905
Labels
info-needed
Issue requires more information from poster
At Zed we allow users to set up multiple code actions to be executed on save.
That breaks with the ESLint language server because the server only looks at the first entry of the
context: { only: [] }
array sent along withtextDocument/codeAction
requests.Example: when we sent a request like this
Then the ESLint server will only look at
"source.organizeImports"
and ignore thesource.fixAll.eslint
. And that has disastrous results: the server will add "disable" comments when executingorganizeImports
— which is not what users want most of the time.@hmttrp tracked the behavior down to the code here:
vscode-eslint/server/src/eslintServer.ts
Line 588 in edc9685
I'm not sure what exactly the intention behind the check is (I don't understand why not all entries are checked), but I think a fix would be to turn the booleans here
vscode-eslint/server/src/eslintServer.ts
Lines 589 to 590 in edc9685
into checks whether the array contains an item of that kind (and not just whether the first item has that kind).
The text was updated successfully, but these errors were encountered: