-
Notifications
You must be signed in to change notification settings - Fork 28.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
intellisense for code actions on save #215475
Conversation
Also as part of documentation, we could maybe note that if there are two of source actions of the same type, but one is a subset of another, only the larger subset would be honored (wording and terms can be better) ie: "editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.fixAll.eslint": "never" in this case, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! I think you should also remove the static contribution tho. This was a proposal that I never actually finalized
One other thing to be aware of is that this intellisense will only pick up code actions for active languages. This at least ensures that only valid source actions are shown, but could also confuse users if they try configuring the setting without activating the language extension first (that's what the static contribution was trying to solve)
You could potentially solve this by caching the source actions for each extension across restarts. May be worth tracking in a new issue
* language registry and code actions on save new filter * fixes logic * more clean up * remove static contribution
* language registry and code actions on save new filter * fixes logic * more clean up * remove static contribution
fixes #161284
related #212381
issue: no intellisense because of how we get contributed or default code actions on save
https://github.com/justschen/vscode/blob/a6bda062d6a861071758ded8abc781af37a083e2/src/vs/workbench/contrib/codeActions/common/codeActionsExtensionPoint.ts#L69
atm, we only search contributions if they statically contribute
code actions
(ie, https://github.com/justschen/vscode/blob/a6bda062d6a861071758ded8abc781af37a083e2/extensions/typescript-language-features/package.json#L1608-L1609)this allows us to gather ALL code actions that are contributed, sorts by source actions, dynamically adds
demo with ruff and eslint installed:
![Screenshot 2024-06-13 at 2 35 09 PM](https://private-user-images.githubusercontent.com/54879025/339560558-da0bdde5-598a-446c-92b4-60c9061fd071.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI5NTY4MjUsIm5iZiI6MTcyMjk1NjUyNSwicGF0aCI6Ii81NDg3OTAyNS8zMzk1NjA1NTgtZGEwYmRkZTUtNTk4YS00NDZjLTkyYjQtNjBjOTA2MWZkMDcxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA2VDE1MDIwNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJmYjEzZmYxYmU4N2VhZWE5ZjdlMzhiNzljZjRhNmVmMjczOThkMTQ3OTRiMGM3ZmMzZDdkN2UxYjRhNDgwMDEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.pYkkwRQhL3m2w8EYf--OaNHjH4GfhPhVrarw6kruWiQ)
![Screenshot 2024-06-13 at 2 34 54 PM](https://private-user-images.githubusercontent.com/54879025/339560569-6dfd9fda-d9cf-4a55-a6ba-67e64b5f7832.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI5NTY4MjUsIm5iZiI6MTcyMjk1NjUyNSwicGF0aCI6Ii81NDg3OTAyNS8zMzk1NjA1NjktNmRmZDlmZGEtZDljZi00YTU1LWE2YmEtNjdlNjRiNWY3ODMyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA2VDE1MDIwNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ3YzI3MzhhMDI1NWUxOGIyZmY4MmJlYzFmY2QzOGI4NDFmODcyZGYwODViNmY2MDVlYTVlMTRmOTJkOWU3MmEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.dsHIhqsdUjcDG-zXXhQg6MziFSXB4Zq2uIpkYrOt26E)
cc. @Yoyokrazy