microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
160.15k stars 28.05k forks source link

Override less specific code action with more specific code action #217869

Open aiday-mar opened 6 days ago

aiday-mar commented 6 days ago

Testing #217611

I set "source.fixAll": "always",. Saving the TS file in the example adds a semi-colon at the end of the second import. I added "source.fixAll.eslint": "never" and "source.fixAll.ts": "never" into that object. Saving the TS file also added a semi-colon at the end of the second import.

I think I was expecting that the more specific line would override the less specific one.

https://github.com/microsoft/vscode/assets/61460952/56b9cd37-bee8-4025-b053-28140ec4dde7

justschen commented 5 days ago

yep this is a known issue with how code actions on save work atm.

right now, we always take the larger superset, so if you have source.fixAll: ____, any other source.fixAll type codeactions will be overridden. we do support language specific overrides though, but i'm not sure if the correct choice is to allow the user with this many options.