Closed fubar-coder closed 2 years ago
I've pushed out an early nightly from the feature branch. Can you confirm that the warnings are gone? If so, I'll merge it in.
It looks good so far. There is still one remaining warning:
0>/home/fubar-coder/Ventuno/siam-web/server/SiamServer.Documents.DocumentSelector/Yoakke.SynKit.Parser.Generator/Yoakke.SynKit.Parser.Generator.ParserSourceGenerator/InjectedSources.ParserAttribute.cs(20,16): Warning CS8669 : Die Anmerkung für Nullable-Verweistypen darf nur in Code innerhalb eines #nullable-Anmerkungskontexts verwendet werden. Für automatisch generierten Code ist eine explizite #nullable-Anweisung in der Quelle erforderlich.
It's a translation of the message Warning CS8669 The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.
and it seems that it requires an explicit #nullable enable
or #nullable annotations
in generated code. My current workaround is to disable this warning in the project, which is fine for me.
Other projects seem to have a similar problem, e.g.: AArnott/CodeGeneration.Roslyn#183
This is an issue with injected sources. I will look through the injected sources and add the appropriate directives.
Thanks, works now as expected! :+1:
Is your feature request related to a problem? Please describe.
I'd like to use StyleCop.Analyzers and it shows warnings, because it's unable to recognize the file as automatically generated.
Describe the solution you'd like
It would be helpful if the automatically generated files would start with the following text:
This would cause the analysis to skip those files. You can find the unit test for skipped files in ExclusionTests.cs in the StyleCop.Analyzers project.
Describe alternatives you've considered
The only alternative I've found is to disable the warnings in the whole project, which is undesirable.
Additional context