-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Move
Code Action Constraints
#58387
Comments
Conceptually some of this sounds right, but it'd help to have an idea of what is still annoying currently since #57080 was merged, and what this issue's proposing. For example:
This one I'd like to have a much better intuition around. |
The main feedback is around the lightbulb widget (which could indicate that at it's core, it could be a VS Code issue that should be fixed on our side) showing up virtually everywhere because the As you know, VS Code automatically requests code actions at each cursor move, typing, etc, and it just happens that Ideally, there are constraints around aggressively showing and having code actions everywhere, especially after telemetry suggests it's not being used in the automatically, and only when explicitly clicking |
Hi @justschen, @DanielRosenwasser thank you for opening this issue. We currently believe the action is returned too often even after the changes, and after discussing with the team, we believe a good condition for showing the action would be the following. Make the action appear when both ends of the primary selection are on a top-level scoping symbol such as |
Notes from TS editor sync:
TLDR: do not show if automatically triggered (then lightbulb will also not show), only if requested from |
Looks like #58548 fixes this, but the GitHub "closes" pattern didn't kick in because of the ##. Feel free to reopen, but otherwise thanks @justschen! |
Acknowledgement
Comment
related #56416 and https://github.com/microsoft/TypeScript/pull/57080/files
We had some discussion within the VS Code team regarding the changes @aiday-mar made and how we wanted to make the constraints tighter.
the current sentiment after discussion:
Move to...
code actions. however, it should be available to them if they manually select (viaRefactor
orCmdCtrl + .
)Move to...
actions.Reasoning behind not having the lightbulb be so aggressive in suggesting code actions is that the lightbulb loses value (ie, blue lightbulb means there are fixes, but yellow lightbulb is super general). Even if users don't explicitly hit the lightbulb button, when they see certain changes in the lightbulb, they might hit
CmdCtrl + .
to trigger the code actions.when actually selecting a range of code, I believe @aiday-mar had some proposed fixes for the constraints as well, similarly looking at scoping.
In our latest stable release (1.89.0), i added a good amount of telemetry tracking a few things that might help us make a more informed and concrete decision if we want to move forward with this:
move to...
is being used when the source is the lightbulb widget.move to file
)currently have a draft PR for our built in extension, but as Matt mentioned, likely would be best to fix here so the behavior is consistent across all editors.
I'll likely take a look at making a PR here, so any help would be appreciated!
Let me know if there are any thoughts on this, if we think it's too drastic, if we want to see more telemetry, etc.
cc. @mjbvz @navya9singh @andrewbranch @aiday-mar
The text was updated successfully, but these errors were encountered: