I have a small Resharper Template I have written for Null check of a function Parameter (C#).
Check.IsNotNull($param$, "$param$"); - Suggest Parameter - #1
I can now null check t开发者_JAVA技巧he function paramters one by one. But I want to be able to null check all the paramters at once through a template. Is it Possible in Resharper?. Is there someting like a "$Foreach" using which I can loop through parameter variables and write the code to check them one by one ?. (without writing out the foreach into the code)
I see that the "Alt + Ins" does something similar. (Taking all Properties on the class and making them as parameters of a constructor). So hoping that there's a way out.
Sadly, there isn't a way to do that right now. I created an issue at youtrack.jetbrains.net though: RSRP-263951 Live templates: ability to create templates that write code for each parameter/property/field etc.. Vote there if you want to see this feature in future versions of ReSharper.
精彩评论