Ok, don’t be cross with me, I know the comments aren’t clean code. But sometimes we need them. ReSharper templates is excellent possibility to write your comments quicker and personalized so you can ask the next time: “hey guy what did you meant with this?”.

Create ReSharper Template

Choose from the ReSharper menu Template Explorer entry image  In the Template Explorer choose in Scopes C# and then click on the New Template image In the new template write the following code. With the $ sign are marked parameters. The name of the parameters is up to you. image The name of the Shortcut is the word (or sequence of words) which triggers, together with the TAB, the template generation. The Availability defines where is the template accessible and Parameters is list of parameters we defined in the code before. image You assign Macro for each parameter as shown above and uncheck the Editable availability, except for the comment parameter. You save the template and you are ready to go. You can setup in the ReSharper Options Menu which items should be shown in To-do Explorer. image

Demo

About the Author Anton Kalcik

I’m enthusiastic with a passion for working with and for people. I love what I do. Most of the time, I assist people in the creation of valuable software. I’m a software engineer and entrepreneur specializing in .NET  and Microsoft Azure. I offer Code Katas, Coding Dojos, workshops and talks about .NET, Microsoft Azure, DevOps, Agile Methodologies and Clean Code. I'm founder of CoderDojo Wien and president of digital.austria association.

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.