resharper-unity
resharper-unity copied to clipboard
Please add support for UniTask
Hi,
UniTask (https://github.com/Cysharp/UniTask) is a super nice library for having async/await support for Unity, e.g. it allows to await Tasks in Coroutines or await Addressables.LoadAssetAsync etc.
You also can mark Unity's Start method to be a UniTask, like this:
private async UniTaskVoid Start() {
// ...
}
Rider now reports two things:
- "Incorrect return type" which is not true (see https://github.com/Cysharp/UniTask#async-void-vs-async-unitaskvoid at the bottom of this section)
Startis never used (that's a following error from 1.)
It would be super nice, if the plugin could handle the usage of UniTask.
Thanks!
It is acceptable to return any instance of the struct/class of any Unity function.
It is not strongly related to the UniTask (JB doesn't like 3-party dependencies).
//all are valid
private string OnEnable() => "";
private int OnEnable() => 1234;
private Guid Update() => default;
private MyClass FixedUpdate() => default;
Furthermore, Unity will release analog of the UniTask some day and this issue will need to be solved in future anyway.
Notification slipped through. :)
Furthermore, Unity will release analog of the UniTask some day and this issue will need to be solved in future anyway.
Indeed, good hint! An according to the linked blog post, they are talking with UniTask so it seems like a win-win situation :)