-
Notifications
You must be signed in to change notification settings - Fork 1.8k
C#: Enable nullability in Extraction.CSharp #5197
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
Conversation
csharp/extractor/Semmle.Extraction.CSharp/Entities/CommentLine.cs
Outdated
Show resolved
Hide resolved
eb7d46c
to
2494324
Compare
89fca5d
to
ff858b5
Compare
ff858b5
to
bd2b3e7
Compare
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.
Looks good to me; a few minor suggestions.
csharp/extractor/Semmle.Extraction.CSharp/Entities/CachedEntity.cs
Outdated
Show resolved
Hide resolved
csharp/extractor/Semmle.Extraction.CSharp/Entities/CommentLine.cs
Outdated
Show resolved
Hide resolved
csharp/extractor/Semmle.Extraction.CSharp/Extractor/NonStandaloneAnalyser.cs
Outdated
Show resolved
Hide resolved
}); | ||
} | ||
|
||
private static ExitCode AnalyseNonStandalone( |
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.
Should this be in NonStandaloneExtractor.cs
?
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.
I didn't want to change even more things. I think the best would be to get rid of the public static class Extractor
altogether and move its bits maybe to StandaloneAnalyser
and TracingAnalyser
.
return analyser.TotalErrors == 0 ? ExitCode.Ok : ExitCode.Errors; | ||
} | ||
|
||
private static void AnalyseStandalone( |
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.
Should this be in StandaloneExtractor.cs
?
…ase CachedSymbol entity
This PR is the fourth in multiple steps to enable nullability analysis and remove nullability warnings. It's based on #5189. This PR enables nullability analysis on the Extraction.CSharp project. I added some
#nullable disable warnings
directives where I couldn't get around some warnings. The biggest such section is in theAnalyser.cs
, where we have a two phase initialization with theInitializeStandalone
/EndInitialize
, and therefore we have a lot of nullable fields. I think it's not worth the effort to try to fix these. (It seems quite cumbersome to do it without changing our log messages, which might be considered a breaking change.)The last commit is independent of nullability analysis. It combines the standalone and normal analysis into a single method. However, it needs quite a few
Func/Action
parameters, so in the end it didn't help too much with readability. Nevertheless, I think it would make sense to combine these two paths.Differences job Differences jobDifferences job