JetBrains / JetBrains/resharper-unity

Allow "introduce field and initialise in Start/Awake" context action outside of performance critical context

Open
#2,292 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.2k
Forks
142
PR merge metrics
No merged PRs in 30d

Description

There is currently a context action for usages of `GetComponent` inside a performance critical context that will introduce a field and initialise it in `Start` or `Awake`. This action isn't available outside of performance critical context methods, which makes it harder to introduce a field and move the initialisation. We should extend availability to any component.

Ideally, this should also be integrated with the Extract Field refactoring, but that requires changes to the platform. See [RIDER-75534](https://youtrack.jetbrains.com/issue/RIDER-75534)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.