The Q2 2013 Release of JustCode is here!  As always, there are a host of new features, performance improvements, and all around awesome sauce included in this release.

New Features

Debug Decompiled Code

The biggest rock in this release is the ability to decompile and debug dependent assemblies right in Visual Studio.  For more information, please see this detailed blog post.

File Templates

In addition to the rich insert and surround templating features for C#, VB.NET, HTML, CSS, LESS, and JavaScript, JustCode now provides file templates as well.  To help with the file templates, we’ve introduced two additional macros:

  • Suggest Namespace ($1=SUGGEST_NAMEPSACE()$)
  • Suggest FileName ($1=GET_FILENAME()$)

There are several ways to expand a File Template:

  • Press CTL-ALT-INS (or select “Expand File Template” from the JustCode Visual Aid) in the Visual Studio editor – this adds the file at the same level and folder in your project as the file your were viewing in the VS editor
  • Right click in Solution Explorer and select “Just Expand File Template” (or press CTL-ALT-INS in Solution Explorer) – this adds the file at the currently selected level in Solution Explorer.

An example of a file template that I use for Test Driven Development is shown in Listing 1.

$NEW_FILE$
using System;
using NUnit.Framework;
using Telerik.JustMock;
using Telerik.JustMock.Helpers;
 
namespace $1=SUGGEST_NAMESPACE()$
{
   [TestFixture]
 public class $2=GET_FILE_NAME()$
    {
        [Test]
 public void Should$3$()
        {
        	|
        }
    }
}

Listing 1 – NUnit Test Fixture File Template

New Code Template Macros

In addition to the two new macros introduced for File Templates, we’ve introduced two additional template macros in this release:

  • Retrieve current type name in a code template
  • Retrieve current member name in a code template

To get the name of the encasing type, simply add the macro as shown in Listing 2.

$1=GET_TYPE_NAME()$

One example of where getting the current member is valuable is in WPF applications where you need to add a call to NotifyPropertyChanged in your setters, and a sample template for this use case is shown in Listing 3.

NotifyPropertyChanged("$1=GET_MEMBER_NAME()$");

Listing 3 – Adding call to NotifyPropertyChanged

New Test Runner Features

There are four main improvements to the JustCode test runner:

  • Toggle Word Wrapping in
    • Details
    • Console Output
    • Console Errors
  • More detailed information when a test fails
  • Settings to determine what should happen when the code changes
    • Build the whole solution
    • Build Targeted Projects
    • Do Nothing
  • Added the Test Duration in the Test Results tab

image

Figure 1 – New Test Runner enhancements

Excluding a Folder from Namespace

JustCode provides a quick fix to correct the namespace of an object based on the default namespace and the folder path of the files location in the project.  If  you don’t want to include a folder into the namespace, you can set the folder to be ignored in the namespace configuration.  To set this flag, open the properties windows for the folder, and change the “Do Not Contribure to Namespace” setting to “True”.  This dialog is shown in Figure 2.

image

Figure 2 – Choosing a folder’s impact on namespace configuration

New Refactoring Commands

A highly requested feature in the feedback forum (located here) was to convert instantiation of an object using property names to one using the object initializer format (and vice versa).  Looking at the code in Listing 4, this is a class that initializes the FirstName, LastName, and Age properties after the initial call to “new”. 

var foo = new foo();
foo.FirstName = "Bob";
foo.LastName = "Smith";
foo.Age = 42;

Listing 4 – Object Initialization using property statements.

By opening the refactoring menu in JustCode (as in Figure 3), you can see the new menu item “To Object Initializer”. 

image

Figure 3 – Refactor Menu

Executing this refactoring will then produce the code in Listing 5. The reverse refactoring “To Assignment Statements” can be used on statements using Object Initializers.

var foo = new foo()
{
    FirstName = "Bob",
    LastName = "Smith",
    Age = 42
};

Listing 5 – Converted to Object Initialization

Summary

This isn’t even all of the new features in JustCode Q2 2013!  To see the complete list, please see the What’s New Page.  Better yet, download the latest version and give it a spin!

JustCode download banner image


Japikse
About the Author

Phil Japikse

is an international speaker, a Microsoft MVP, ASPInsider, INETA Community Champion, MCSD, CSM/ CSP, and a passionate member of the developer community. Phil has been working with .Net since the first betas, developing software for over 20 years, and heavily involved in the agile community since 2005. Phil also hosts the Hallway Conversations podcast (www.hallwayconversations.com) and serves as the Lead Director for the Cincinnati .Net User’s Group (http://www.cinnug.org). You can follow Phil on twitter via www.twitter.com/skimedic, or read his personal blog at www.skimedic.com/blog.

 

Comments

Comments are disabled in preview mode.