Skip to content

Mark attributes with [MeansImplicitUse] so JetBrains doesn't complain #73

Description

@Atulin

Currently, classes that are not explicitly instantiated get a green underline with a "Class is never instantiated" message

Image

The local fix to that, is to add [UsedImplicitly] attribute from JetBrains.Annotations nuggie:

Image

However, it requires every class that's registered with II to be annotated with it, which can be quite noisy. Thankfully, there's a better way: [MeansImplicitUse] (docs) which makes it as if every class decorated with the given attribute had [UsedImplicitly] on it.

The only gotcha is that those attributes are stripped during compilation, so the package will have to be compiled with set JETBRAINS_ANNOTATIONS variable.

As a side note, if it works as advertised, it could also be great for IH.

Alternatively, make the attribute classes partial so the [MeansImplicitUse] can be applied at user's discretion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions