Skip to content

Net223 rider-79869 IBaker Usage inscpection suppression #2370

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

Closed
wants to merge 6 commits into from

Conversation

jorgeamado
Copy link
Contributor

https://youtrack.jetbrains.com/issue/RIDER-84159/Class-derived-from-Baker-should-be-marked-as-used

using Unity.Entities;
using Unity.Rendering;

class CannonBallAuthoring : UnityEngine.MonoBehaviour
{
}

class CannonBallBaker : Baker<CannonBallAuthoring>
{
    public override void Bake(CannonBallAuthoring authoring)
    {
        // By default, components are zero-initialized.
        // So in this case, the Speed field in CannonBall will be float3.zero.
        AddComponent<CannonBall>();
        AddComponent<URPMaterialPropertyBaseColor>();
    }
}

@jorgeamado jorgeamado marked this pull request as ready for review October 28, 2022 14:57
@jorgeamado
Copy link
Contributor Author

Please review after #2369

@@ -59,7 +59,10 @@ public bool SuppressUsageInspectionsOnElement(IDeclaredElement element, out Impl
IsUxmlFactory(cls):
flags = ImplicitUseKindFlags.InstantiatedNoFixedConstructorSignature;
return true;

case IStruct @struct when unityApi.IsUnityType(@struct) ||
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Why only struct? System also could be class
  2. Why are you setting implicit use for any "IsUnityType"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Class is processed on the line 55

@@ -55,7 +55,9 @@ public UnityApi(UnityVersion unityVersion, UnityTypeCache unityTypeCache, UnityT
type != null && myUnityTypeCache.IsUnityType(type);

public static bool IsDotsSystemType([NotNullWhen(true)] ITypeElement? typeElement) =>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IsDotsSystemType -> IsDotsType (baker is not system)

@jorgeamado
Copy link
Contributor Author

Will be merged via TeamCity pipeline

@jorgeamado jorgeamado closed this Nov 2, 2022
@citizenmatt citizenmatt added this to the Rider 2022.3 milestone Nov 3, 2022
@jorgeamado jorgeamado deleted the net223-RIDER-79869-new-dots-support branch November 3, 2022 13:44
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