How to repeat Resharper pattern?

I have a small Resharper template that I wrote to nullify the Parameter (C #) function.

Check.IsNotNull ($ param $, "$ param $"); - Suggest a parameter - # 1

Now I can check parameters parameters one by one without errors. But I want to be able to immediately check all the parameters immediately through the template. Is this possible in Resharper ?. Is there something like "$ Foreach" with which I can cycle through parameter variables and write code to check them one by one ?. (without writing foreach to code)

I see that "Alt + Ins" does something similar. (Taking all the properties in the class and entering them as constructor parameters). Therefore, hoping that we have a way out.

+4
source share
1 answer

Unfortunately, there is no way to do this right now. I created a problem on youtrack.jetbrains.net though: RSRP-263951 Live templates: the 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.

+1
source

Source: https://habr.com/ru/post/1310350/


All Articles