Enhance your Visual Studio Productivity with Telerik JustCode

Posted by: Chris Eargle , on 4/26/2011, in Category Product Articles
Views: 64531
Abstract: Visual Studio is a proven and tested IDE for the production developer, but despite its many powerful features, there are areas that can be enhanced to improve developer productivity. Telerik JustCode is one of the most feature rich products available, while also being unobtrusive and allowing you take advantage of it when needed without slowing Visual Studio down or getting in your way when you just need to code.

This article provides useful information about the Telerik JustCode Product

Visual Studio is a proven and tested IDE for the production developer, but despite its many powerful features, there are areas that can be enhanced to improve developer productivity. The market today is abundant with Visual Studio plug-ins offering a wide array of enabling features, but choosing the best one for your particular needs can be a daunting task. Such tools are able to identify errors in your code in real time and suggest solutions, they can alert you to problems that can result from changing a snippet of code somewhere, or boost your productivity by quickly generating whole sections of code, or provide you with templates that you can use.

The Extension Manager feature was included in Visual Studio 2010 to allow you to effortlessly locate such add-ins. You can easily access the extension manager by going to Tools | Extension Manager.

extensionmanagermenu

One such tool that can easily be found by the Extension Manager is Telerik JustCode. Simply select the Online Gallery, then type JustCode in the search box and press enter. When JustCode is found, click the Download button next to it. This will take you to Telerik’s website to download a trial edition of JustCode.

JustCode is designed to work for you in an unobtrusive manner, providing the features you need to write code efficiently: code analysis, error checking, smart code navigation, code templates, and powerful refactorings. It also allows you to run unit tests from a variety of frameworks and clean your code according to rules your team has agreed on.

extensionmanager

The first thing you may notice with JustCode is the symbols appearing in the right gutter of the code editor. This is the analysis engine indicating the location of errors and warnings. JustCode works in a background process which does not slow Visual Studio down while it performs the analysis in real-time. It works on C#, VB.NET, ASP.NET, XAML, JavaScript, HTML, and other file types. These indicators are useful for quickly locating lines that require attention for improving code quality.

indicators

Navigating through errors and warnings from JustCode is as simple as clicking the indicator in the gutter. Advanced navigation is provided through the JustCode menu or the keyboard shortcuts. The menu also allows you to ignore errors or warnings.

navigatingwarnings

You may at times deal with long blocks of code where the beginning and ending blocks of code aren’t clear. JustCode includes a visual aid known as structural highlighting to enable the prevention of errors due to improper blocking. This feature draws lines indicating the start and end of a block of code. Finding the beginning or ending of a segment of code now merely requires a glance.

structuralhighlighting

Writing code level documentation can be a time consuming process, which JustCode helps accelerate. Simply place the cursor on a member name and press Ctrl+Shift+D to get started. The generator infers appropriate text based upon the member and type, leaving additional details to be filled in by you. This is the default documentation generated for the constructor for a Rule class, which saved several keystrokes.

documentation

Source code navigation saw many improvements in Visual Studio 2010. One example of this is the ‘Navigate To’ dialog. JustCode provides enhancements on top of these new features by allowing you to navigate to a specific section of code that you need by file, type, symbol, or member. Navigating to a type will take you to any type, such as a class or struct, in C# or VB.NET. Go to symbol searches types and members in C#, VB.NET, and JavaScript.

navigation

In addition to providing you with this functionality, JustCode allows you to navigate to members based upon analysis of the code. This allows you to find base types, inheritors, members returning the type, and members accepting the type as an argument. It also enables you to find overriding and overridden members. Instead of combing through large codebases, you can now find what you’re looking for quickly and efficiently.

If you happen to navigate to metadata using the ‘Go To Definition’ feature, only the signatures of the type and its public members are displayed. Although this is useful for determining what is available in a class, at times it is necessary to determine the implementation due to incorrect or unknown behavior. By pressing Ctrl+1, JustCode will decompile the type allowing you to see the class’s implementation.

decompile

Have you ever been lost while coding? Perhaps the most useful feature on large projects is ‘Locate in Solution Explorer’. Press Shift+Alt+L and the current file is selected in the Solution Explorer pane.

JustCode enhances code formatting through several features. When the Learn Code Style From File command is run, it will analyze the file and formulate a set of code style rules specific to the language of file in which the command was run. These rules are customizable, and the Visual Studio formatting options can be used.

Code styles can differ between solutions, particularly when different team members or organizations are involved. JustCode allows options that are commonly unique to a solution to be stored in solution options. Open JustCode, Options…, and then select Options Sharing. Click the Create solution options button. After saving, the options are stored with the solution file as *.jcsettings.xml. This can then be checked into source control and shared with team members. This makes it easier for developers to adhere to a project’s coding standards.

sharedoptions

For those who enjoy a clean code base, the Clean Code command will do much of the work for you in one pass. The code will be formatted according to the formatting settings, redundancy and unused code will be removed, and better language constructs will be utilized if possible. This feature allows for the creation of a profile to store your preferences for use through the life of your project.

codecleaning

When designing applications, implementation patterns emerge that require some degree of typing. Code templates remove this repetitive behavior by allowing you to define code along with the variable snippets. One such pattern is the Notify Property used in MVVM applications. Setting this up in JustCode is quite simple. Click the JustCode menu, select Options…, expand Code Templates and select C#.

codetemplates

Click the Add button. Set the Acronym text to ‘np’. Then type the following in the editor.

public $1$ $2$
{
get
{
return $3=SELECT_VARIABLE($1$)$;
}
set
{
$3$ = value;
RaisePropertyChanged("$2$");
}
}

Here is a screenshot of the completed dialog.

codetemplateeditor

Click Save on the Code Template Editor dialog and the Options dialog. With this code template added, you can add notify properties to your ViewModel classes with ease. Inside of the class, type np then Shift+Space.

notifyproperty

Type in the return value for V1, the property name for V2, and the private member for V3, tabbing to each field. Then press enter to complete the template entry.

Although Visual Studio has built in support for unit testing, it is limited to MSTest, Microsoft’s unit test framework. Many projects use other frameworks, and although test runners are provided, there are varying degrees of integration with Visual Studio. JustCode Unit Test Runner supports five frameworks: MSTest, xUnit, NUnit 2.5, MbUnit 2.4, and MSpec. Since JustCode can support multiple testing frameworks at once, it makes transitioning from one framework to another a breeze.

The runner allows for different test groupings to match your style or to help you filter to a particular set of tests to run. Tests can also be searched or selected individually. After a set of impacted tests are selected and run, the test runners allow you to rerun the last set. This is very useful in large solutions when running the full test suite may take minutes.

unittest

JustCode adds additional refactorings and enhances the ones provided by Visual Studio. A notable addition is Add Stubs in Inheritors. If an abstract member is added to a class, this refactoring allows you to automatically implement stubs in all derived classes. Enhancements include finer grained control over the action the refactoring will take. For example, Extract Interface allows you to not only select properties, but choose which accessors the interface will include.

There are many productivity enhancing tools available through the Extension Manager’s Online Gallery, and it is a good idea to discover what is available to make Visual Studio work for you. Telerik JustCode is one of the most feature rich products available, while also being unobtrusive and allowing you take advantage of it when needed without slowing Visual Studio down or getting in your way when you just need to code.

Give a +1 to this article if you think it was well written. Thanks!
Recommended Articles
Chris Eargle is a Telerik Developer Evangelist, Microsoft Most Valuable Professional – C#, and two-time INETA Community Champion from Columbia, SC, USA. He has over a decade of experience designing and developing enterprise applications, and he runs the local .NET User Group: the Columbia Enterprise Developers Guild. He is a frequent guest of conferences and community events promoting best practices and new technologies. His blog, kodefuguru.com, has been featured on ASP.NET, MSDN, and Reddit


Page copy protected against web site content infringement by Copyscape


User Feedback
Comment posted by Happy Coder on Wednesday, April 27, 2011 2:04 AM
Anyone tried the justcode tool with Resharper? Any known issues?
Comment posted by Any known issues on Wednesday, May 18, 2011 12:49 AM
Any known issues
Comment posted by jessi on Saturday, May 10, 2014 7:41 AM
jessi

Post your comment
Name:  
E-mail: (Will not be displayed)
Comment:
Insert Cancel