What does "Enable nullability analysis when C# 8 compiler nullable warnings are enabled" do?
Under Resharper Options | Code Inspection | Settings there is an option: "Enable nullability analysis when C# 8 compiler nullable warnings are enabled".
What does this actually do, and in what circumstances would you want to turn it on or off?
Please sign in to leave a comment.
There is a comprehensive artiucle about this here: https://blog.jetbrains.com/dotnet/2020/05/26/nullable-contexts-nullable-attributes/
Hello, I have been having issues regarding Resharper's handling of C#8.0 nullable reference type feature. (BTW, I visited the link you provided above but I keep getting a 503).
I like annotations but why would I or anyone else need to add a designtime dependency to our code just for [CanBeNull] when its a feature built-in to the language? [CanBeNull] was great before C#8 nullable reference types.
I have played around with a lot of the settings and just cannot get it to cooperate. I have been too busy to figure out the cause. Suggestions? I am using Resharper Ultimate version 2020.1.3 in both Visual Studio preview and Pro.
Hello Jason,
Currenty, ReSharper doesn't support properties specified in Directory.Build.props file, please refer to the following request -
https://youtrack.jetbrains.com/issue/RSRP-470254
As for changing nullable reference types [CanBeNull] annotation, could you please provide some code screenshot demonstrating the specified behavior?
Thank you.
Hello Jason,
Concerning changing nullable reference type to [CanBeNull] annotation, please disable typing assist for this case by unchecking ReSharper | Options | Editor | Behavior | C# | Annotate nullability on '!'/'?' after type name.
Hope it helps.
Thank you.
Hello Jason,
One note about support of properties specified in Directory.Build.props file. ReSharper should support such properties - https://youtrack.jetbrains.com/issue/RSRP-480672#focus=Comments-27-4317354.0-0
Could you please
* make sure that the following option is enabled - ReSharper | Options | Environment | General | Read solution model directly
* try clearing caches and reopen solution.
Please let me know if it helps.
Thank you.