You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would love to have some refactor tool that could suggest non-nullable variables from my parameters or any variable. So when the cursor is on the parameters, it can suggest to insert code:
Actual Behavior:
MyMethod(int?intOrNull,string?strOrNull){
...}
Expected Behavior:
MyMethod(int?intOrNull,string?strOrNull){// Suggested refactor: Convert null, to 0IntintOrNullParam=intOrNullParam??0;// Suggested refactor: Convert null to empty stringstringstrOrNullParam=strOrNull??"";
...}
What would be the best solution here?
Should also handle variables:
bool?boolOrNull=null// Suggested refactor: Convert bool to falseboolboolOrNullVar=boolOrNull??false
Would this only affect primitives? Structs (which have default 0 values)? This refactor would be called something like " coerce default value" but "" isn't actually a default value and string.Empty is idiomatic anyway.
I would love to have some refactor tool that could suggest non-nullable variables from my parameters or any variable. So when the cursor is on the parameters, it can suggest to insert code:
Actual Behavior:
Expected Behavior:
What would be the best solution here?
Should also handle variables:
What would be the best solution here?
Similar issue:
#411
The text was updated successfully, but these errors were encountered: