resharper-unity icon indicating copy to clipboard operation
resharper-unity copied to clipboard

Refactor GetComponent<> calls

Open HnngKoos opened this issue 5 years ago • 3 comments

There should be a suggestion to refactor GetComponent<ComponentType>() calls into a member variable of the ComponentType + initialization using GetComponent<ComponentType>() in the Awake() method. Don't show the suggestion if the call is in the Awake() method.

HnngKoos avatar Feb 19 '20 14:02 HnngKoos

We are showing that quick fix for GetComponent in performance critical context, but I think we should show it everywhere for GetComponent

krasnotsvetov avatar Feb 24 '20 13:02 krasnotsvetov

How's it going?

HnngKoos avatar Mar 24 '21 16:03 HnngKoos

No changes right now. We'll look at this as part of Rider 2021.2

citizenmatt avatar Mar 25 '21 08:03 citizenmatt