How to remove foreach Context Action for IEnumerables?
Is there a way to remove the "Iterate via 'foreach'" on IEnumerables from the quick action context menu (ALT+RETURN)? The option in the menu doesn't seem to affect its behavior, so I would guess it does something else. But since some updates this quick fix action is in first place before assigning my value (only for IEnumerables!) to a local variable, but I never use it. For my behavior it is just annoying and I want to remove this option.
Please sign in to leave a comment.
Hello Christoph!
Sorry for delay in responding.
Could you please provide some sample code and screenshot illustrating the issue?
Thank you.
Hello Angelina,
In the following screenshot you will see an example for the situation:
Usually “Introduce variable” is the first option, when I type “varablename;” and then press ALT+RETURN to get the quick actions. This would be the first option I prefer. Since some releases the “Iterate via ‘foreach’” option for enumerables has moved to the top. This is an option I never use. And it swaps with my always preferred option to introduce a variable. This is annoying!
So I thought: Okay this option is a nice to have feature, but when it annoys me this way and replaces my preferred option, I need to disable it.
So I found the following in the options of resharper:
I disabled this option, but the context action/quick fix remains in the menu.
Kind Regards,
Christoph Meißner
Anything new here?
Hello Christoph!
I've provided the link to the issue in support request that was submitted by you - https://youtrack.jetbrains.com/issue/RSRP-466420.
There are developer's comment that explains the specified behavior.
Thank you.