Closed ajj7060 closed 5 years ago
Thanks for the report, I'll take a look but I might not get to this until next week.
I've looked into this, I don't think it's R# that's causing the issue, it seems like it's actually VS 2019 that is overwriting R# settings in terms of implicit usage. Nothing has changed in MSpec for annotations, so not sure what is going on.
Just to add to this, you know that the annotations only worked if you had a subject attribute on your class, right? It won't work if there is no subject.
I'm going to close this, as this appears to be either a VS or R# issue and not MSpec.
yes, I know the annotations only works with a subject; it used to gray everything out until a Subject attribute was added somewhere.
Are you sure this isn't an mspec thing, because the namespace used to show in the Code Annotations settings in R#, and they don't anymore. When it showed, if you didn't check the checkbox for Machine.Specifications, it wouldn't use them either.
I suspect R# have changed the way the annotations propagate up to the settings UI, there's nothing that's changed in MSpec that would have affected this.
I don't think its just a UI thing; clearly R# isn't recognizing the annotations for mspec anymore. Is this not the right place for issues related to mspec R# integration?
Consider the following cases:
No attributes or annotations
R# reports the field as unused and text coloring shows as unused:
With subject
R# no longer reports as unused, but text coloring still indicates unused.
If you add a public modifier, the text coloring changes to used, which indicates that either R# or the Roslyn analyzer is automatically treating private fields as unused.
With normal R# annotations
R# doesn't report as unused, text coloring indicates unused, same as in case 2.
Adding a public modifier exhibits the same behavior as in case 2.
I hope that's comprehensive enough for you. Bottom line, you won't get warnings in your build if you are running R# analyzers, but the text coloring appears to be off. I'd suggest raising a ticket over at https://youtrack.jetbrains.com if it still bothers you. An alternative is to implement project-level settings using R# settings layers, and fix it that way.
Using the latest MSpec + R# (2019.1.0 and 2019.1.1) in VS 2019, the annotations don't appear to be working and R# says Establish, Because and It delegates are not used and can be removed.
If you open the Annotations settings in R#, it looks like they are still there, but if you clear the checkbox and Save the changes, when you come back they are gone from the custom annotations list.
Let me know if there's somehow more information I can gather.