Skip to content
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

Deprecated: PreferNonAllocApiAnalyzer #2445

Open
JosiahBradley opened this issue May 15, 2024 · 4 comments
Open

Deprecated: PreferNonAllocApiAnalyzer #2445

JosiahBradley opened this issue May 15, 2024 · 4 comments

Comments

@JosiahBradley
Copy link

Referring to the analysis code in resharper/resharper-unity/src/Unity/CSharp/Daemon/Stages/Analysis/PreferNonAllocApiAnalyzer.cs
Unity no longer recommends this but the opposite. Following this inspection will lead to broken code in the future as Unity deprecates these functions. This also caused some unneeded refactors.

Notice of deprecation from Unity:
[Physics2D].[OverlapAreaNonAlloc]

Get a list of all Colliders that fall within a specified area. Note: This method will be deprecated in a future build and it is recommended to use OverlapArea instead.

Recommended action in Project Settings or script:
[Reuse Collision Callbacks]

@citizenmatt
Copy link
Member

Thanks. Please see RIDER-112462

@JosiahBradley
Copy link
Author

@citizenmatt I was the one who triggered that issue being opened via thread necro of https://rider-support.jetbrains.com/hc/en-us/community/posts/11634372238098-NonAlloc-in-Unity-is-either-deprecated-or-ineffective?page=1#community_comment_18933790136466
I'm linking everything together for the next person using a search engine that brought me to the original thread after my own refactor woes.

@citizenmatt
Copy link
Member

Thanks! We'll hopefully get on to this as part of the next release. We'd like to suggest useful transformations, not deprecated ones!

@JosiahBradley
Copy link
Author

Awesome! The inspection code has definitely helped more than not. Glad to assist with the update process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants