Posts Tagged ‘ReSharper 6.1’

ReSharper 6.1.1: New Maintenance Release Available

Thursday, February 16th, 2012

Did you report issues with ReSharper 6.1? Did you take part in the latest early access program? If you did, chances are that your efforts are now being rewarded: we have just made available ReSharper 6.1.1: a new maintenance release of the awesome Visual Studio productivity tool.

Let’s put it this way: if you’re fine with version 6.1, you probably shouldn’t be upgrading to 6.1.1. However, if you’ve been experiencing any of these 40 bugs with 6.1 that are now fixed, go on and download ReSharper 6.1.1.

Most prominent issues resolved for 6.1.1 include code cleanup options not being saved under the new settings engine (RSRP-287390), removing necessary import directives on code cleanup (RSRP-287334), bogus ambiguous reference errors in .cshtml files (RSRP-286884), and file masks applied to a broader set of files than expected (RSRP-287762). Here’s the entire list of fixes.

Enjoy!

Importing / Exporting Templates and Patterns in ReSharper 6.1

Monday, January 23rd, 2012

 

One of the changes introduced with the new settings in ReSharper 6.1 is how importing and exporting of templates and custom patterns are done (Custom Patterns were previously known as Structural Search and Replace).  As part of the unification of settings, Templates and Patterns now fall under the same modus-operandi when it comes to importing and exporting as other settings do. This is very similar to how our IDEA based IDE’s such as IntelliJ, WebStorm et al. work. However, certain legacy functionality is also available depending on what needs to be done.

The de-facto choice

Be it Templates or Patterns, when you want to import or export them, the recommended approach is to use the Manage Options dialog

 

SNAGHTMLa44bc04

 

To export, we merely select Export to File. ReSharper prompts us with a dialog box of what we would like to export:

 

SNAGHTMLa471579

 

At this point we can select whether we want Live Templates, Patterns (StructuralSearch*) or both. It is important to note that if you do not have any user defined templates and/or patterns, then these options are not available, i.e., you would not see the LiveTemplates / StructuralSearch checkboxes.

 

The exported file format is only compatible with ReSharper 6.1 and higher (.DotSettings file).

 

Importing

When it comes to importing templates and patterns, if these are in .DotSettings format, then it is merely about adding another layer. We select the file to import, and are prompted on what settings we’d like imported:

 

SNAGHTMLa62f7ad

 

The benefit of this approach is not only that it keeps all settings centralized, but it also allows us to mount and un-mount related templates.

 

* StructuralSearch comes from the old name giving to Custom Patterns which was Structural Search and Replace

 

Exporting Individual Templates

One option that is currently not available using the Manage Options dialog when dealing with the export of templates is to selectively choose which ones we’d like exported. If we want to only export specific templates, we need to use the Template Explorer (previously named Live Templates)

SNAGHTMLa66c44e

 

We can then select individual templates and choose the Export button. This is basically the old behavior prior to ReSharper 6.1. The difference however is that the file exported is in the new .DotSettings format. In this regard, there is no difference between this approach and the previous Manage Options one.

 

Dealing with legacy templates and patterns formats

The Templates Explorer window also has an option to import Templates

 

image

 

Although this allows the newer DotSettings file format, we usually should only use this when trying to import legacy templates (from version 6.0 and lower).

 

When it comes to Patterns, when trying to import older ones, we can use the Import from R# v6.0- button on the Custom Patterns options page

 

image

 

 

Summary

With the new settings we’ve hopefully made sharing of Patterns and Templates a little easier. There are still improvements to make but any/all feedback or changes you’d like to see are welcome. Please log them in our issue tracker so that they can be managed better.

Per Project Settings or How to have different naming styles for my test project

Wednesday, January 18th, 2012

 

One nitpick that I myself and many have had with ReSharper is not being able to have different naming styles for types based on different projects. In my code I normally name classes using CamelCase

 

image

 

and in my test project I use all_lowercase

 

image

 

Unless you add all_lowercase as a valid naming style, you’ll always end up with those squiggly lines under all your tests. And let’s admit it, it’s not a big deal but it’s annoying. #FirstWorldProblem

 

Say hello to my little layer

With ReSharper 6.1 we introduced the concepts of layers, which open up many new possibilities, including sharing settings on DropBox and or setting company wide standards. What you might not know is that it allows Per Project Settings too! No big deal if you didn’t know, since we currently do not support it via the User Interface so it would be hard to figure it out. However it’s pretty simple to do and I’m going to show you how.

 

Our goal here is to allow all_lowercase settings for classes in our test project (Tests) and not permit the same in other projects (Project). This is the sample project layout we’re going to be working with

 

image

To make this happen, we need to create specific settings for the Tests project and allow the possibility of classes being all_lowercase. That is, the Tests project needs its own DotSettings file.

 

Since there’s no specific button or option to add Per Project settings in the UI, this is where we need to kind of use a workaround. We need to have a Settings file for the project and then edit the options and save it to this file. There are many ways to create this new settings files. We can copy the solution one and rename it, we can export the current settings, we can mount a new layer and have ReSharper create it for us, etc.

We’re going to use this last method. Why? Because since ReSharper mounts it when it creates the file, it will allow us to edit the settings too.

 

 

1. With the Solution open, click on Manage Options under ReSharper

 

2. Under This Computer, click on the Add Layer icon (on the right) and select Create Settings File

image

 

 

3. Save the file to the Tests project folder, in our case that would be under SolutionDir\Tests and name it (and here’s the important part) Tests.csproj.DotSettings. That is, it should be named with the ProjectName, followed by csproj or vbproj based on the type of project and with the extension DotSettings.

 

4. Now that we have the settings file mounted, we need to change the required settings, which in our case is to allow classes to have all_lowercase (this obviously works for other settings too). As such, double-click the recently mounted file or right click and click on Edit

 

image

 

5. The Options dialog comes up. We want to edit the naming styles

 

image

 

Modify any other settings you wish at this point and once done, hit Save on the Options dialog.

 

image

 

At this point, we can remove the mounted settings as its not required for it to actually work. We can also leave it in order to easily access the settings for the project in the future. If you do leave it, make sure you uncheck the checkbox so that settings are not applied to the entire solution.

 

[Recommendation: If you decide to leave the settings mounted, mount these under Solution Shared or Solution Personal as opposed to This Computer so that you don’t end up with a long list of different settings files]

 

 

As soon as we hit Save, the new settings automatically are picked up by ReSharper and take effect. We can now see that the naming style no longer appears incorrect under the Tests project

 

image

 

and if we try and use the same style in the actual Project we do get the warning

 

image

 

The UI will come

Once you do this once, you can pretty much copy the same file over to your different projects and rename it to match the project name. In one of the next versions of ReSharper we will provide a more intuitive UI (or should we say we’ll provide an actual UI) for this. For now however, I think this minor hack will make a few people happy!

Introducing ReSharper 6.1 SDK

Wednesday, January 18th, 2012

This post is about ReSharper 6.1. For other features in ReSharper 6 (both 6.0 and 6.1), please see previous posts introducing ReSharper 6. Those cover support for JavaScript (including unit testing with QUnit), CSS, ASP.NET MVC 3 Razor, and Async CTP; bundled decompiler; explanations on ReSharper inspections; fine-tuning file headers; ReSharper settings revised in 6.1 (and their company-wide usage); recent improvements in IntelliSense options, and optimizing assembly references


Though every new release of ReSharper comes with extra features and functionality, there are always things that our users want that don’t come out of the box. This includes things like, for example, support for various unit test frameworks as well as various bits of functionality that are domain-specific or related to particular challenges a user is facing.

Luckily, ReSharper has always shipped with an Open API which provided the opportunity to write plug-ins — extensions to the core ReSharper mechanisms that would be provided in separate files and integrated into ReSharper at start-up. While the opportunity was always there, and has resulted in a number of plug-ins being written, there’s never been any framework that would simplify the task for plug-in developers. Until now.

With the release of ReSharper 6.1, we have also introduced the ReSharper SDK — a separate framework that has been designed to make plug-in development easier. The SDK includes the following:

  • ReSharper assemblies, including PDBs and documentation XML files. These files include not just the core ReSharper assemblies, but also the unit test framework, which lets you write unit tests for your plug-in.
  • MSBuild target files, which make referencing the ReSharper assemblies a lot easier.
  • Project and item templates for VS2010, which make getting started with plug-in development a breeze.

Two packages are provided with the SDK: the MSI installer, which comes with all of the above, as well as a ZIP package, which contains only the assemblies and target files, and is provided to help build and test plug-ins in Continuous Integration systems such as TeamCity. Both packages contain introductory documentation to help you get started, with the bulk of documents related to plug-in development available online. These documents contain a variety of topics such as how to port your plug-in to use the SDK, develop support for a new language, or deploy the plug-in. The documents are being actively developed, and you’re welcome to comment on them should things start getting unclear.

The SDK packages are available on the ReSharper Downloads Page under Related Downloads. The following JetBrains TV video provides a comprehensive overview of the various SDK features including plug-in development, testing and configuration under TeamCity.

Optimizing Assembly References with ReSharper 6.1

Tuesday, January 3rd, 2012

This post is about ReSharper 6.1. For other features in ReSharper 6 (both 6.0 and 6.1), please see previous posts introducing ReSharper 6:


One of the prominent new features in ReSharper 6.1 is the ability to easily manage your existing assembly references, browse usages of referenced assemblies, and remove unused references.

In fact, this is not a single feature but three features. Each of them is outlined below:

  • Optimize References. This is the main feature for analyzing referenced assemblies. It can be invoked on any single project from the project’s own context menu or from the context menu of the References node in Solution Explorer:

    The Optimize References tool window displays assembly references that are both unused and used in the current project, and shows how exactly references are used. The feature does not require your project to be compiled, which means you can invoke it even if your project is currently broken.

    One of the best things about this feature is that it allows you to explore usages of a specific referenced assembly, namespace or type; filter them by kind, group them and navigate from them directly to your source code. The screenshot below illustrates exactly why this project references EasyHttp.dll, which types from that assembly are used and where:

    Different icons mean different kinds of usages like read, write, attribute, or invocation usages — the same usage filtering functionality that is used in all other ReSharper search features based on Find Results window. However, one kind of usages is unique for Optimize References: it’s called “related usages” and indicates implicit (non-direct) assembly reference usages required for the compiler.
    In the simplest case, related usages are caused by a type’s hierarchy. That is, if you use a certain type, you have to reference all assemblies containing that type’s supertypes. Unfortunately, this is just one example along with many others which are much more complicated!
    In addition to exploring assembly usages, you can delete unused assembly references directly from this tool window — the toolbar contains two buttons, Remove all unused references and Remove selected references:

    Note that this feature also deletes all redundant C#, VB.NET or XAML namespace import directives which reference namespaces from the assemblies being removed.
  • Remove Unused References. This refactoring quickly detects unused assembly references without displaying their usages. Since it works faster than Optimize References, it is very useful if you don’t want to a full-fledged usage analysis and you’re just looking for a quick cleanup of your project references.

    Clicking Analyze Used References… button in this dialog box will open the Optimize References tool window for a thorough analysis of reference usage.
  • Safe Delete Assembly Reference. This refactoring either silently removes selected assembly references or opens a confirmation window indicating that some of the selected references are used (and shows how they are used.) The refactoring is available on pressing Alt+Del on an assembly reference (or references) selected in the Solution Explorer, or via Refactor This shortcut menu.

These 3 features introduced in ReSharper 6.1 will definitely help you maintain your solution and get rid of redundant dependencies. By the way, keep in mind that if you want to find out which code is referenced in a given scope other than a project (for example, in a folder or in a method), you can use ReSharper’s Find Symbols External To Scope feature that has been recently made available as the Referenced Code option via Navigate To shortcut menu.


The original post is authored by Kirill Skrygan (@kskrygan on twitter), ReSharper developer and the the author of the Optimize Assembly References feature set.

ReSharper 6.1.1 Early Access

Friday, December 30th, 2011

Do you like ReSharper 6.1? Judging by the feedback that keeps arriving via multiple channels, most users are happy with performance improvements and extended functionality.

However, could there be a release of an application as complex as ReSharper without bugs? This is very unlikely, and we do know that 6.1 RTM does have certain issues that affect a part of its audience.

With that in mind, we’re planning to deliver another minor update early next year that would exclusively focus on fixing issues discovered with 6.1 that don’t imply any substantial architectural changes. For the most part, the issues have to do with the new settings engine not always persisting changes.

Meanwhile, we felt it would be fair to deliver a build that would incorporate fixes implemented this far before the team goes on holidays until Jan 10. That said, everyone who is affected by this set of issues with 6.1 is welcome to download the initial build from ReSharper 6.1.1 Early Access Program. Expect further early builds mid January.

OK we’re done for the year. See you around in 2012!

ReSharper 6.1: Improvements in IntelliSense Options

Tuesday, December 27th, 2011

This post is about ReSharper 6.1. For other features in ReSharper 6 (both 6.0 and 6.1), please see previous posts introducing ReSharper 6:



ReSharper 6.1 introduces more fine-grained control over Intellisense.

image

As shown in the screenshot, in addition to the two older options (enhancing Visual Studio’s Intellisense with ReSharper or leaving as is) we can now select which technologies to apply Intellisense to. It is important to note that by de-selecting a technology, we do not switch off Visual Studio Intellisense for that technology, but only eliminate ReSharper’s enhancements of it.

Defining Autopopup behavior

The way Intellisense works inside Visual Studio, including ReSharper’s, is that matching elements appear as you type, allowing you to select the option by hitting Tab or Enter

This default behavior can be very productive, but it can also prove somewhat annoying, specially when we’re doing things like Test Driven Development or any kind of Create from usage scenario. For instance, we are trying to write a class or method that does not exist. We write it out and hit Enter, Intellisense completes it with the nearest match

In order to avoid these situations, we have added a new feature to ReSharper 6.1 which allows us to control not only where we want Intellisense to appear, but also how. That is, in addition to selecting the technology such as HTML, C# or XAML, we can now fine-tune Intellisense in each of these. Under ReSharper | Options | Intellisense | Autopopup we have the following screen

SNAGHTML82e9576[4]

Much like the Code Inspections, it is divided into different tabs based on the technology and an All tab that displays all entries. If we look through the list, we can see that under C#, we have several options, one of them being
SNAGHTML8326fdc

By default, all entries have the value “Display and preselect” which results in the behavior shown in the previous video. We can however change this with two other options

  • Do not display which will completely disable Intellisense
  • Display but do not preselect which will display matching values but will not preselect it.

This latter option is what we need in our case. We’d like to know of existing elements, but not necessarily have them completed when hitting Enter or Tab, etc. The video below displays this new behavior

Same as we have done with the After ‘new’, we can do with many others.We have tried to think of the most common scenarios where one would like to control this behavior. Please let us know if you feel something is missing. Hopefully however, this makes working with Intellisense productive and often less intrusive.

ReSharper 6.1, dotCover 1.2 and dotTrace 4.5.2 Performance Released

Tuesday, December 20th, 2011

Christmas is only a few days away and we’ve decided to celebrate it a little earlier by releasing not one, but all three of our main .NET tools: ReSharper 6.1, dotCover 1.2 and dotTrace 4.5.2 Performance.

ReSharper 6.1

As covered in previous posts, this release of ReSharper is much more than a few bug fixes.

Settings

In ReSharper 6.0 we laid the foundations for what would be the new settings management engine. This was quite a substantial change, both from an architectural point of view as well as functional. Unfortunately due to that pesky little annoyance called time, we did not manage to finish it for the 6.0 release. We have now though and ReSharper 6.1 introduces a wealth of new possibilities for sharing settings across solutions, teams, machines and even company-wide policies. And we’re still not done with settings, so keep your feedback coming for further releases.

image

Performance improvements

For every single release of ReSharper, we invest a large amount of time in performance improvements. This often isn’t an easy task since new releases also include new functionality. In 6.0 we had some serious performance issues with certain types of web projects. This has now thankfully been resolved in 6.1 and we’ve made 6.1 faster in many areas. Numbers are impressive: we have fixed 140 performance problems for 6.1.

Async and Visual Studio 11 support

Async support in C# is still in CTP stage. Visual Studio 11 is in early developer preview. Trying to support technology that is not entirely finished proves not only challenging but also risky. Any major changes could deem most of the work we’ve performed as obsolete. However, we know that you, our users, play with the early bits and miss ReSharper.

image

That’s why in 6.1 we provide support for Async features in C# and VB.NET, as well as initial experimental support for Visual Studio 11. Support for Metro style applications is not yet included, and in order to install ReSharper into VS11 Developer Preview, you have to use a separate .vsix installer available at ReSharper downloads.

Optimizing assembly references

Many users rely on ReSharper in streamlining their project maintenance tasks, and this new feature is a nice addition to the existing project-level toolset. In any project in your solution, ReSharper 6.1 detects assembly references that are not effectively used, and helps remove some or all of them.

image

SDK

During 6.0 development we invested heavily in trying to provide a better API for extending ReSharper. 6.1 also sees the birth of this effort. Along with an improved API, we also now provide a testing framework, Visual Studio templates for creating plug-ins, samples, as well as online documentation. ReSharper 6.1 SDK is available for download as a .msi or .zip package.

image

More awesome features

Here are a few more great features also added:

  • Structural Search and Replace for HTML and ASP.NET. You can now use Custom Patterns to refactor both HTML and ASP.NET markup.
  • Call tracking for ASP.NET MVC. Same call tracking features, extended to ASP.NET MVC 3.
  • New code inspections. Access to disposed closures, covariant array conversions and more.

We have also fixed many outstanding issues. Look for more blog posts describing 6.1 features and improvements in future here on the JetBrains .NET tools blog.

dotCover 1.2 and dotTrace 4.5.2 Performance

These are mainly maintenance releases with a primary focus of supporting ReSharper 6.1. In addition, dotCover 1.2 works side-by-side with TypeMock 6.2.x, provides performance improvements in report generation, reduces HTML report size and memory consumption.

Note that we are already working on next major dotCover and dotTrace Performance releases. EAPs are expected soon, exposing a ton of new functionality and improvements, so stay tuned for that.

Download them all!

You can download ReSharper 6.1, dotCover 1.2 and dotTrace 4.5.2 Performance right now!

Last but not least, we’d like to wish everyone very Happy Holiday season. Stay safe and see you all in the New Year!

ReSharper 6.1: The Finish Line

Tuesday, December 13th, 2011

A couple of days ago, we have started to release ReSharper 6.1 nightly builds in production mode, with build 30 being the first one of the new breed.

What sets production builds apart from regular development builds is that exceptions are suppressed, meaning no more wild life in the right corner of the status bar, and performance is slightly better due to lower count of checks, asserts and whatnot. Basically, production mode builds is what you get when we deliver betas, release candidates, and final release builds.

What it all means for you is that if you’re generally reluctant to trying nightly builds due to the annoyance of exception reporting and general mistrust, this might be the right moment for you to test-drive ReSharper 6.1 before we release it — even more so considering that we’re not planning any beta releases prior to 6.1 RTM.

Having said that, please grab a fresh nightly build and try it out. Here’s the list of issues that separate us from releasing 6.1. If you think there are any more show-stopper level issues, please be quick to ping us here in comments or by creating a bug report. Thank you!

ReSharper 6.1 Settings: DropBox and Company-wide

Tuesday, December 6th, 2011

This post is about ReSharper 6.1. For other features in ReSharper 6 (both 6.0 and 6.1), please see previous posts introducing ReSharper 6:

EAP Warning: This post is based on ReSharper 6.1 Early Access Program and some things such as screenshots and minor details might vary from the time this has been written to the time of release.

In a previous post on ReSharper 6.1 Settings, we introduced the concept of layers and covered a few scenarios when it comes to sharing of settings across solutions. In this post we’re going to cover a few more, namely: syncing settings over DropBox and providing a global setting for all projects across a company.

Syncing with DropBox

As developers we often end up working on multiple machines, whether it is that we own a desktop and laptop, or two desktops, one at work and one at home, or any other combination of scenarios, we have the need to alternate between machines. With the new layers settings in ReSharper 6.1, sharing the same settings in these cases has now become quite easy.

The idea is simple: add a new Global Layer and host the file in a DropBox folder (I’m using DropBox, but obviously you can use any other mechanism that syncs files remotely). In order to do this, we first need to export the current settings to that new file and then mount it.

1. Click ReSharper | Manage Options…

image

2. Select the Global Settings and click on Export to File. It will prompt for a filename. The idea is to place this file in a Dropbox folder. Select everything from the following screen except Housekeeping

image

It is important to note that only items that currently have non-default values will be displayed in this window. For instance, under PattersnAndTemplates, we’d see an entry of StructuredSearch if we were to have some custom patterns in the current context, as shown below

image

3. Select Add Layer | Existing File and select the file created in the previous step.

image

[Note: This screen will most likely be updated in a future release to combine the “ReSharper Global Settings” under the group header as this is a default layer that cannot be removed and therefore cannot intervene in normal operation such as priority]

We now have to repeat step 3 for each of our machines. Once we do that, the settings will automatically be loaded every time DropBox syncs.

Providing Company-Wide Settings

It should be pretty apparent that providing company-wide settings across all projects is pretty much the same as sharing via DropBox. We just need to provide a file. If we want to provide solution company-wide settings, we’d add the layer to the solution group. This would allow an alternative way of sharing settings which wouldn’t require the file to be checked in to source control.

Other operations to perform with Settings

Settings can be imported, exported, activated and deactivated (marking the checkbox or unchecking) at any point. We can also Copy To button to copy settings from one layer to another layer, making it also easy for sharing. In essence you can do pretty much anything you like now.

Why so many layers?

You might be thinking, if I could setup my settings to read from a specific file, why would I want more layers or the ability to order them in priority?. The idea with layers is that each one can add one or more configuration settings. This means that for instance a company could have a layer where only code formatting settings are defined, another layer where templates are defined and so on and so forth. When we export settings to a file as shown in two, we define which settings we want exported. We do not have to select them all like we did previously. We could for instance only choose to export Templates, and mount a layer where only these are defined. ReSharper can understand that there are different options in different layers and provides us access to them all. We don’t have to worry about this. The only thing we might need to take into account is if one layer overrides another one’s settings. That’s where the Move Up / Move Down comes in, allowing us to specify the priority.

Summary

The layers provide a lot of flexibility when it comes to sharing settings, either between two machines, a team or company-wide. Use them, abuse them. Give us your feedback.