You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
lightbulb widget with move symbol to action covers code in python #202767
Hi roblourens thank you for posting this issue. That's curious, I thought that TypeScript offers only Move to file and move to new file actions. I did a search for move symbol to in our repo and do not find results. Perhaps this is an action contributed by another extension Matt Bierner (@mjbvz) ?
Maybe further discussion could having another setting (like onCode) which minimizes lightbulb being shown by only showing lightbulb for if there are more than a certain # of refactors (these code actions have the refactor type iirc) or if there are quick fixes? This way we're not just fixing in each extension, and it might be a more blanket approach. No real preference here, just want to throw some smol ideas out there.
Hey Justin Chen (@justschen) those are good ideas. Indeed on most cursor positions, there are code actions available in the lightbulb menu, so it appears very often. We can indeed decide to show the lightbulbs only if more than 'n' actions are available where 'n' could be defined by the user. The issue I see here is that we would need to define some sort of importance metric, so that importance code actions when present, always make the lightbulb appear. I also think that with this change it could be that the lightbulb does not show up in cases where the user would have expected it to.
I know there is importance in certain contexts already:
in code actions: isPreferred (boolean) which is used in the context of quick fixable fixes
in diagnostics: severity (number)
both don't really help in this case since the code option appearing is basically the same move to actions that we wanted to not show everywhere, just contributed differently it seems. but definitely could field some discussion on other ways as well to improve visibility (maybe something like taking a look at max line/column length and showing the lightbulb at the end of line instead of above the cursor? just to chuck another idea out there).
Agreed. For the move to action, I am working on a PR to make it appear less often. Perhaps here we should also track the extension which is contributing the code action and notify them that the code action appears too often.
Activity
aiday-mar commentedon Jan 19, 2024
Hi roblourens thank you for posting this issue. That's curious, I thought that TypeScript offers only
Move to fileandmove to new fileactions. I did a search formove symbol toin our repo and do not find results. Perhaps this is an action contributed by another extension Matt Bierner (@mjbvz) ?justschen commentedon Jan 19, 2024
Aiday Marlen Kyzy (@aiday-mar) it might be contributed from python/pylance?
Maybe further discussion could having another setting (like onCode) which minimizes lightbulb being shown by only showing lightbulb for if there are more than a certain # of refactors (these code actions have the refactor type iirc) or if there are quick fixes? This way we're not just fixing in each extension, and it might be a more blanket approach. No real preference here, just want to throw some smol ideas out there.
aiday-mar commentedon Jan 19, 2024
Hey Justin Chen (@justschen) those are good ideas. Indeed on most cursor positions, there are code actions available in the lightbulb menu, so it appears very often. We can indeed decide to show the lightbulbs only if more than 'n' actions are available where 'n' could be defined by the user. The issue I see here is that we would need to define some sort of importance metric, so that importance code actions when present, always make the lightbulb appear. I also think that with this change it could be that the lightbulb does not show up in cases where the user would have expected it to.
justschen commentedon Jan 22, 2024
Aiday Marlen Kyzy (@aiday-mar) that's a good point!
I know there is importance in certain contexts already:
isPreferred(boolean) which is used in the context of quick fixable fixesseverity(number)both don't really help in this case since the code option appearing is basically the same
move toactions that we wanted to not show everywhere, just contributed differently it seems. but definitely could field some discussion on other ways as well to improve visibility (maybe something like taking a look at max line/column length and showing the lightbulb at the end of line instead of above the cursor? just to chuck another idea out there).[-]There is no escape[/-][+]lightbulb widget with `move symbol to` action covers code in python [/+]aiday-mar commentedon Jan 22, 2024
Agreed. For the
move toaction, I am working on a PR to make it appear less often. Perhaps here we should also track the extension which is contributing the code action and notify them that the code action appears too often.justschen commentedon Jul 15, 2024
fixed by #221419 and microsoft/TypeScript#58548