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
Nullable annotate ListViewGroup #2828
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2828 +/- ##
===================================================
+ Coverage 59.43311% 59.43618% +0.00307%
===================================================
Files 1236 1236
Lines 429535 429538 +3
Branches 38780 38781 +1
===================================================
+ Hits 255286 255301 +15
+ Misses 168887 168879 -8
+ Partials 5362 5358 -4
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Just a heads up: we're currently blocked by our downstream consumers and unable to update to the latest .NET Runtime, which contains the latest compiler needed for the Roslyn analysers. |
9a881d7
to
f1c90d0
Compare
f1c90d0
to
69ca0de
Compare
You need to apply PubllicAPI analyzer fixes to record the changes to the public API surface. |
69ca0de
to
f873b17
Compare
f873b17
to
3d70f53
Compare
Right... So I think I've figured out how to do this. For my sanity:
There's one more things that I think is a bug in the analyzer. There is an error
public ListView.ListViewItemCollection Items
=> _items ??= new ListView.ListViewItemCollection(new ListViewGroupItemCollection(this)); and in the `PublicApi.Shipped.txt":
So I'm confused why this error occurs Please can there be some sort of option to just regenerate |
/cc @jcouv in case this is a bug |
Yup. This is very obviously a bug. See the latest commit for the fix. I am guessing the analyzer doesn't understand |
This marker just documents that this API still mentions an oblivious type. The purpose is to help track annotation effort (ie. remove all those markers).
Yes, when the publicAPI file includes
I'm confused too. Just to confirm, was the line in publicAPI file ( Let's sync on Monday. We can do LiveShare or Teams meeting to troubleshoot.
If you mean the publicAPI analyzer, then I don't think so. That analyzer only looks at public APIs, not the bodies/implementations of methods. |
Depending on the warning, a fix should be offered at the location of the warning. Select the desired fix (with Project or Solution scope) and that should be it. |
ab46e81
to
9b85178
Compare
src/System.Windows.Forms/src/System/Windows/Forms/ListViewGroup.cs
Outdated
Show resolved
Hide resolved
I don't think it is possible, PST, GMT and AEST don't overlap... I'd like to sync up about dotnet/roslyn-analyzers#3582 |
9b85178
to
883cf13
Compare
Yeah you're right. I've updated ListViewGroup.Header/Footer to have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
The builds is failing complaining about annotations.... Right now NRT annotation feel like a tremendous up hill battle. 😩 |
883cf13
to
b46282a
Compare
I know... I may be blind, but I don't get the error
|
I played around with this a bit, looks like the tool cannot handle nested classes as return values. Probably needs to be raised as an issue somewhere else. |
I suspected as much! |
Consider annotating your code without putting |
Confirmed the bug with return of nested type. Will fix asap |
Hum, seems like I spoke too soon. I cannot repro the issue (found a bug with a compiler API, but that's not the one used by the publicAPI analyzer...). Below is the test to verify that. I wonder if you may be using a version that predates this fix. I'll take a look at your package versions and get back to you. [Fact]
public async Task AnnotatedMemberInAnnotatedShippedAPI()
{
var source = @"
#nullable enable
public class C
{
public string? OldField;
public string? {|RS0036:Field|};
public string {|RS0036:Field2|};
public Nested? {|RS0036:Field3|};
public Nested {|RS0036:Field4|};
public class Nested { }
}
";
var shippedText = @"#nullable enable
C
C.C() -> void
C.Nested
C.Nested.Nested() -> void
C.OldField -> string?
C.Field -> string
C.Field2 -> string
C.Field3 -> C.Nested
C.Field4 -> C.Nested";
var unshippedText = @"";
var fixedShippedText = @"#nullable enable
C
C.C() -> void
C.Nested
C.Nested.Nested() -> void
C.OldField -> string?
C.Field -> string?
C.Field2 -> string!
C.Field3 -> C.Nested?
C.Field4 -> C.Nested!";
await VerifyCSharpAdditionalFileFixAsync(source, shippedText, unshippedText, fixedShippedText, newUnshippedApiText: unshippedText);
} |
Alright, I dug into this. It is indeed a problem that was fixed in more recent publicAPI analyzer. I didn't trace the fix down though. @mavasani I noticed that the most recent publicAPI analyzer on nuget is 3.0. But on myget, we're up to 3.3-beta. |
Just published https://www.nuget.org/packages/Microsoft.CodeAnalysis.PublicApiAnalyzers/3.3.0-beta1.final, which should have all the changes to this analyzer. |
Looks like the build agent is unable to find the analyzer:
|
I'd accidentally reverted the version with a wrong |
Thank you! |
/cc: @Logerfo looks like we are starting to make progress |
Docs: dotnet/docs#17085 |
Proposed Changes
Microsoft Reviewers: Open in CodeFlow