You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The custom annotation provider recognises Unity's [Range] and [Min] attributes and applies the [ValueRange] annotation so that integer data flow analysis knows the range of these serialised fields.
This isn't working - no warnings are shown for e.g. if statements that check a value known to be outside of the range. This appears to be because the [ValueRange] attribute doesn't resolve correctly in a Unity project - the JetBrains.Annotations.ValueRangeAttribute type doesn't exist in Unity's copy of the annotations, while adding an implementation to the project fixes everything.
The implementation resolves against the "External annotations" PSI module, which should contain a copy of JetBrains.Annotations.dll. I thought this was enough to make the annotation resolve correctly, and thought it was working like this during testing. But testing is manual only, because external annotations are not loaded during automated testing. It might also have worked during manual testing because the editor plugin used to include an internalised version of the attributes, but have recently been removed (see #1762).
The text was updated successfully, but these errors were encountered:
The custom annotation provider recognises Unity's
[Range]
and[Min]
attributes and applies the[ValueRange]
annotation so that integer data flow analysis knows the range of these serialised fields.This isn't working - no warnings are shown for e.g.
if
statements that check a value known to be outside of the range. This appears to be because the[ValueRange]
attribute doesn't resolve correctly in a Unity project - theJetBrains.Annotations.ValueRangeAttribute
type doesn't exist in Unity's copy of the annotations, while adding an implementation to the project fixes everything.The implementation resolves against the "External annotations" PSI module, which should contain a copy of JetBrains.Annotations.dll. I thought this was enough to make the annotation resolve correctly, and thought it was working like this during testing. But testing is manual only, because external annotations are not loaded during automated testing. It might also have worked during manual testing because the editor plugin used to include an internalised version of the attributes, but have recently been removed (see #1762).
The text was updated successfully, but these errors were encountered: