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

Compare API versions ignoring missing build numbers #1807

Merged
merged 4 commits into from
Aug 25, 2020

Conversation

citizenmatt
Copy link
Member

Rider 2020.2 updated API information for ScriptableObject.OnValidate. It is undocumented up to Unity 2020.1, and documented from Unity 2020.2. The implementation of Version.CompareTo will treat missing build and revision numbers as older, so a maximum API version of 2020.1 is less than the product version of 2020.1.1, and since this is also less than 2020.2, Rider does not find a record for ScriptableObject.OnValidate.

This change introduces an extension method for Version - CompareToLenient. This will only compare the components of both versions that are defined, so 2020.1 is considered equal to 2020.1.1. This fixes the issue for ScriptableObject.OnValidate.

Fixes RIDER-49130

@citizenmatt citizenmatt added this to the Rider 2020.2.2 milestone Aug 21, 2020
@citizenmatt citizenmatt self-assigned this Aug 21, 2020
@tbg10101
Copy link

OnValidate is now documented in 2018.4, 2019.4, and 2020.1.

@citizenmatt
Copy link
Member Author

Ah! Thanks for the heads up. I'll update the API specs to show that - makes them a little more complicated, but I think it will still work ok.

@citizenmatt
Copy link
Member Author

I don't see it documented for 2018.4 or 2019.4. But it is documented for 2020.1. I'll update the specs for 2020.1. It's still listed for earlier versions, but marked as undocumented.

@tbg10101
Copy link

tbg10101 commented Aug 24, 2020

Sorry, my comment was for MonoBehaviour.

Any chance it can be added there as well? Or should that be another ticket?

@citizenmatt
Copy link
Member Author

MonoBehaviour.OnValidate is already supported.

Screenshot 2020-08-24 at 3 21 27 pm

@tbg10101
Copy link

You are right, I don't know what I was thinking. Sorry for the churn.

@citizenmatt
Copy link
Member Author

No worries 😄

@citizenmatt citizenmatt merged commit 8b2a055 into net202 Aug 25, 2020
@citizenmatt citizenmatt deleted the bug/RIDER-49130 branch August 25, 2020 09:23
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

Successfully merging this pull request may close these issues.

3 participants