ReSharper for C++ Early Access Program Goes Public

Do you recall how we announced that ReSharper was going to support C++ last summer? Well we’re still serious about that: as serious as the folks who are working next door on a separate, cross-platform, IntelliJ-based C++ IDE.

We’ve been running private ReSharper C++ Early Access Program (EAP) for several months now. Out of 1200+ developers who subscribed to receive private builds, over 600 did in fact receive them. Great thanks to all subscribers who, by virtue of submitting info about their development environments, helped us significantly in sorting out what to support in a priority fashion and what to leave in the backlog for now.

As we now have a sufficiently good idea of how devs are working on C++ in Visual Studio, there’s little sense to keep the gates closed. That said, we’re now opening ReSharper C++ EAP to the public.

Before you go and download and play with the latest EAP build though, you should totally read the following and mind the limitations that are inherent to the current state of ReSharper C++ EAP. Here are the things you should know about ReSharper C++ EAP.

What is supported

  • C, C++03 and a part of C++11
  • Code bases up to 40Mb
  • Most Boost libraries

What is not supported

  • Code bases exceeding 40Mb
  • Microsoft libraries including MFC, ATL and WTL
  • Certain C++11 features including variadic templates, raw string literals and trailing return types. Lambdas are supported partially
  • An array of MS preprocessor extensions
  • An even wider array of MS C++ extensions

If you’re not sure if a C++11 feature or an MS C++ extension that you’re using is supported, the ReSharper C++ EAP page contains a full list of known issues and unsupported items, which you’re highly encouraged to examine before you decide to download and install an EAP build.

Posted in How-To's | Tagged , , , | 18 Comments

Introducing ReSharper 8.2 EAP

Yes, you read that right. We’ve just released the EAP version of 8.2, which replaces the previous 8.1.1 EAP.

We’ve been working hard on fixes and especially on improved TypeScript support, and we’ve decided that the number of new features should be a whole new version, and not just a maintenance release. We’ll publish a blog post soon taking a look at some of the changes.

As ever, with a new minor release, we’ve got some changes to APIs, which means existing plugins need to be updated. Plugin devs can find some guidance on our resharper-plugins Google Group.

You can download ReSharper, as well as the ReSharper Command Line Tools from the ReSharper 8.2 EAP page. Give it a go, let us know how you get on.

Posted in How-To's, News and Events, ReSharper Tips&Tricks | Tagged , , , , , | 23 Comments

Webinar Recording and Q&A: ReSharper Secrets with Igal Tabachnik

The recording of our February 13th webinar with Igal Tabachnik, ReSharper Secrets, is now available on JetBrains YouTube Channel.

In this session you will learn about ReSharper hidden gems, powerful annotations and 3rd party plugins to help you become a true ReSharper ninja!

Watch as Igal takes you behind the scenes of ReSharper and shows you how to use this knowledge in your own code, to get even more out of ReSharper. The intended audience is intermediate-to-advanced ReSharper users.

We received a lot of questions during the webinar and we’d like to use this opportunity to include the most frequently questions, as well as those we didn’t have a chance to answer during the webinar.

Q&A on Igal’s Visual Studio setup and ReSharper plugins that he uses

Q: Where does that “number of references” annotation in Igal’s Visual Studio come from?
A: It is called CodeLens. This feature is a part of Visual Studio 2013 Ultimate but is not included in any of Visual Studio’s lower-end editions. Addressing a related question, no, we’re not planning to replicate the functionality of CodeLens in ReSharper.

Q: What ReSharper plugins does Igal use?
A: He uses a whopping 14 of them! Here’s the full list:

  1. Agent Mulder
  2. Enhanced Tooltip
  3. JetBox
  4. Nancy Plugin for ReSharper
  5. Preview Tab Behaviour
  6. Go to Word
  7. InternalsVisibleTo Helper for ReSharper
  8. NuGet support for ReSharper (bundled plugin)
  9. Postfix Templates
  10. ReSpeller Pro
  11. Live Template descriptions
  12. unit test provider
  13. Joar Øyen’s extensions for ReSharper
  14. Locate File or Folder in Solution Explorer

If you’re using ReSharper 8.0 or above, go to ReSharper | Extension Manager to install any of these plugins.

Q: What was the tool that changed .var into a variable assignment?
A: This cool plugin is called Postfix Templates. If you want to have it installed, go to ReSharper | Extension Manager | Online and search for postfix. If you’re ready to contribute, here’s the plugin’s github repo.

Q&A on code annotations

Q: Does using ReSharper’s code annotations have any performance impact?
A: No. They are just attributes, thus they do not affect your compiled assembly’s performance. As for ReSharper performance, the attributes are cached and the analysis is run even without attributes, so there is no performance difference there.

Q: What do I need to do exactly for importing the annotations?
A: There are two options. First, you can paste the source code of JetBrains annotations into your project. To do that, go to ReSharper | Options | Code Annotations | Copy default implementation to clipboard. Paste that into a new file, and you’re done. The second option is to reference a library called JetBrains.Annotations.dll that you can take from ReSharper’s installation folder.

Q: Can I have a single annotations file in the entire solution, or is Annotations.cs created for every assembly/project you create?
A: You are free to put Annotations.cs in a shared assembly, as long as it’s referenced.

Q: Do I need to ship the library containing annotations with my code?
A: If you add annotations by referencing JetBrains.Annotations.dll, then yes, you’ll need to ship the dll with your application. If you add them as a source file, they are compiled in your assembly, and there are no extra references to ship.

Q: What if a project uses ReSharper annotations, but another developer does not have ReSharper installed? Do these annotations work for them?
A: No, the warnings and analysis are provided by ReSharper. The annotations essentially provide hints for ReSharper’s analysis. If you don’t have ReSharper installed, they are just attributes that no one uses.

Q: Can I make ReSharper treat everything as [NotNull] by default so that and I can use [AllowNull] instead?
A: You can change ReSharper’s default assumption by going to ReSharper | Options | Code Inspection | Settings and change the value of Assume entity value can be null. The default value is optimistic (assumed to be not null) but you can change it to pessimistic (assumed to be null).

Q: Regards [Pure] can ReSharper not simply look at the method return type as not being void instead?
A: No, because e.g. string.ToUpper() is a pure method. It returns a new string without changing any of the fields of the current string instance. Calling it without assigning to a variable is pointless. If we add [Pure], ReSharper will warn you that the return value is unused.

For more information on using code annotations, see ReSharper online help and two prior blog posts: ReSharper NullReferenceException Analysis and Its Contracts and Contract Annotations in ReSharper 7.

Join us Tuesday, February 25th for our next webinar, dotMemory 4: What’s Inside with Maarten Balliauw.

Igal TabachnikIgal Tabachnik is a software developer from Israel, who values clean code, test-driven development and continuous refactoring to reduce complexity, reduce bugs and achieve better design. He frequently speaks at local ALT.NET and Software Craftsmanship user groups. Igal is also the author of the Agent Mulder plugin for ReSharper, a plugin that helps ReSharper understand DI containers, providing navigation to and finding usages of types registered or resolved by those containers.
Posted in ReSharper Tips&Tricks | Tagged , , , , , | 9 Comments

Live Webinar – dotMemory 4: What’s Inside, February 25th

Join us Tuesday, February 25th, 15:00 – 16:00 GMT (9:00 – 10:00 AM EST) for our free webinar, dotMemory 4: What’s Inside with Maarten Balliauw.

Even if your program is just a few lines of code, .NET’s runtime will create a number of objects in memory. Are all objects being destroyed by the garbage collector? Or is there a potential memory leak? And why is the application seemingly slow when having lots of objects in memory?

In this webinar, we’ll explore the new dotMemory 4 memory profiler. We’ll see why we want to use a memory profiler and how easy it is to use dotMemory for that. There will be an opportunity to ask questions during this webinar.

Space is limited, please register now.

Maarten BalliauwMaarten Balliauw is a Technical Evangelist at JetBrains. His interests are all web: ASP.NET MVC, PHP and Windows Azure. He’s a Microsoft Most Valuable Professional (MVP) for Windows Azure and an ASPInsider. He has published many articles in both PHP and .NET literature such as MSDN magazine and PHP architect. Maarten is a frequent speaker at various national and international events such as MIX (Las Vegas), TechDays, DPC and others.
Posted in dotMemory Tips&Tricks, How-To's | Tagged , | 1 Comment

JavaScript Improvements in ReSharper 8.1

With JavaScript’s continuous rise to fame, it only makes sense for us to continue improving JS support in ReSharper. The following is an exposition of some of the new ways in which ReSharper 8.1 makes JavaScript coding faster as well as safer.

Completion Helpers via TypeScript

When working with pure JavaScript files, it’s actually possible to improve ReSharper’s code completion functionality by including TypeScript type definitions in your libraries. In order to add this kind of support, you need first of all to search NuGet for DefinitelyTyped packages:

NuGet search for DefinitelyTyped packages

Without the TypeScript annotations, ReSharper’s code completion is limited by what it can infer from the source JavaScript file. Since JavaScript is a dynamically typed language, it is not always possible to acquire complete information regarding the imported symbols and the relationships between them. That is why, apart from the inferred members (which are shown in bold in the completion list), ReSharper also shows all properties of all symbols found in the current solution. In this case, however, it is up to the user to check whether a particular element does in fact have a particular member which, in itself, is a potential cause of additional errors.

For example, in the above use of underscore.js, ReSharper is not able to infer the properties of the _ (underscore) symbol, and thus the developer has to pick from all identifiers. In addition, function parameter information is not available.

JavaScript completion without TypeScript information

After the addition of the strongly typed definitions from the *.d.ts file, ReSharper shows the members that are permitted for the _ symbol in bold, and proceeds to offer those members by default. This reduces the risk of error.

JavaScript code completion with DefinitelyTyped definitions

Also, ReSharper is able to provide information about function parameters:

JavaScript parameter information via DefinitelyTyped definitions

JavaScript SSR

The ReSharper Structural Search & Replace (SSR for short) lets you perform search and replace operations not with a fixed search string or a regex pattern, but rather allows you search for a structural definition that lets you match individual constructs, such as variable names, literals, and so on. And now it’s available in JavaScript.

So let’s start with a simple example of searching for a declaration of objects with a single property assignment:

ReSharper 8.1 JavaScript SSR

The above pattern uses the Name placeholder to locate anything that can be considered a variable or property name. The Find Results window then gives you a listing of all the locations code matching the pattern has been found.

Of course, finding things is only half of what you can do, because you can also perform replacements. For example, say you wanted to replace explicit Array declarations with square-brace syntax. Here’s how you would define such a pattern:

ReSharper 8.1 JavaScript SSR Search with Pattern

This pattern uses yet another placeholder which allows $args$ to represent any number of arguments to a function.

It’s important to note that SSR mechanisms are semantically aware. Here’s an example: searching for a condition $x$ > 100 will correspondingly match if (100 >= x):

ReSharper 8.1 JavaScript Conditional Inversion Match

Similarly, prefix and postfix operators are matched interchangeably, assuming, of course, that no assignments are made:

ReSharper 8.1 JavaScript Postfix Prefix Matching

Also note that SSR ignores non-significant tokens such as curly or round braces or semicolons:

ReSharper 8.1 JavaScript SSR Ignore Insignificant Tokens

And finally, it’s possible to generate search patterns directly from code:

ReSharper 8.1 JavaScript Find Similar Code

File Structure Window Improvements

One of the biggest problems with JavaScript development is actually figuring out the organizational structure that a block of JS code represents. To facilitate this, the File Structure window has been redone to facilitate the presentation of both JavaScript and TypeScript code. Let’s take a look at some of the features.

First of all, function names are inferred either from declarations or variable names:

ReSharper 8.1 JavaScript File Structure Function Name Inference

ReSharper is also able to determine element names from documentation when they are not available explicitly:

ReSharper 8.1 JavaScript File Structure From Documentation

The file structure window uses an ellipsis … to indicate additional arguments. Consider the varArgsFunction below; it sees that the arguments value is being used:

ReSharper 8.1 JavaScript File Structure Parameter Inference

Some function call expressions actually represent higher-level constructs called modules. ReSharper attempts to recognize these structures and present both their private and exported members. Note that, for a constructor, we try to present its fields, too:

ReSharper 8.1 JavaScript File Structure Module Support

Smart Usage Search

We’ve already mentioned this in our blog post on TypeScript, but it bears reiterating: ReSharper 8.1 supports a new feature called Smart Usage Search. When searching for usages of a property, for example, ReSharper is capable of locating both the ordinary usages as well as so-called smart usages – usages where the type is intelligently inferred. The end result appears as follows – note that the feature is supported in both JavaScript and TypeScript:

ReSharper JavaScript and TypeScript Smart Usages

That’s It (For Now)

We hope you enjoy these new features! Rest assured, we continue to work hard on JavaScript and TypeScript support in ReSharper, so expect to see new features soon!

Posted in ReSharper Tips&Tricks | Tagged , , , , , | 8 Comments

Live Webinar: ReSharper Secrets with Igal Tabachnik, Feb. 13th

Join us Thursday, February 13th, 15:00 – 16:00 GMT for our free webinar, ReSharper Secrets with Igal Tabachnik.

In this session you will learn about ReSharper hidden gems, powerful annotations and 3rd party plug-ins to help you become a true ReSharper ninja! Igal will take you “behind the scenes” of ReSharper, and show you how to use this knowledge in your own code, to get even more out of ReSharper.

The intended audience is intermediate-to-advanced ReSharper users. There will be an opportunity to ask questions during the webinar.

Space is limited; please register now.

Igal TabachnikIgal Tabachnik is a software developer from Israel, who values clean code, test-driven development and continuous refactoring to reduce complexity, reduce bugs and achieve better design. He frequently speaks at local ALT.NET and Software Craftsmanship user groups. Igal is also the author of the Agent Mulder plugin for ReSharper, a plugin that helps ReSharper understand DI containers, providing navigation to and finding usages of types registered or resolved by those containers.
Posted in How-To's, News and Events, ReSharper Tips&Tricks | Tagged , , , | 4 Comments

ReSharper 8.1.1 Goes EAP: More TypeScript Support + Fixes

There’s got to be at least one more maintenance release in the 8.x family, and we’re taking the first step in this direction.

ReSharper 8.1.1 EAP is, first of all, about expanding TypeScript support. Apart from architecture improvements that you can’t see right away, v8.1.1 brings popular ReSharper features to TypeScript such as naming inspections, “create from usage” quick-fixes and navigation combos with support for path filtering in Go to Everything, Go to File, Go to Type:

Other than that, ReSharper 8.1.1 EAP brings a (modest) set of fixes that are mostly related to unit testing (4 fixes) and ReSharper Command Line Tools (5 fixes). Here’s the entire list of issues fixed in 8.1.1 so far.

At this point we suggest that you download ReSharper and/or ReSharper Command Line Tools from the ReSharper 8.1.1 EAP page only if you’re interested in TypeScript development and/or if any of the fixed issues are directly relevant to you; otherwise you can safely skip this EAP.

Posted in How-To's | 8 Comments

Videos from JetBrains .NET Tools Evening in Prague

The video recordings from our JetBrains .NET Tools Evening in Prague are now available for your viewing pleasure. The December 18th event was a great success and we are already considering future cities.

We would like to thank Dmitri Nesteruk for his sessions, our Prague team for coordinating the event, and of course all of our attendees who took their time to join us. Stay tuned for upcoming events at a location near you and in the meantime enjoy these photographs and the videos in our playlist below.

This YouTube playlist includes:

An Introduction to JetBrains .NET Tools Evening in Prague
Dmitri Nesteruk gives a quick introduction to JetBrains .NET Tools Evening in Prague on December 18, 2013

Session 1: What’s New in ReSharper 8.1
In this talk, we’ll take a look at the new features of ReSharper 8.1. We’ll discuss the support for new technologies, new tools, refactorings, inspections and other goodies that 8.1 gives to developers.

Session 2: How ReSharper Improves Visual Studio 2013
With the release of Visual Studio 2013, some of you might be left wondering: is there anything that ReSharper has that VS2013 does not? Answering with a resounding YES, this session is all about the ways ReSharper enhances almost every aspect of Visual Studio as well as bringing entirely new features to the table.

Session 3: JetBrains and .NET (it’s not just R#)
It’s not just ReSharper that we’ve got in the .NET space! Whether you’re after code coverage, profiling or super-powered decompilation facilities, this talk will show you the tools we make to help you succeed in all these tasks.

Session 4: Domain Specific Languages and More
In this bonus session, Dmitri presents some of the more advanced programming concepts, talking about domain-specific languages, code generation, domain transformations as well as the ever-expanding horizons of the software development microcosm.

Stay tuned to this blog and @ReSharper for future events.

Posted in dotCover Tips&Tricks, dotPeek Tips&Tricks, dotTrace Tips&Tricks, News and Events, ReSharper Tips&Tricks | Tagged , , , , , | Leave a comment

XAML Improvements in ReSharper 8.1

Double completion meets XAML

As one of the code completion improvements in ReSharper 8, we introduced a powerful and easy-to-use concept called double completion. When working with C# or VB.NET, should the code completion list fail to provide the item you need in particular context, you can just hit Ctrl+Space one more time to extend the completion list either with items that were previously filtered out or with items whose references to be imported (this paradigm also applies to import and smart completion).

XAML editor code completion in ReSharper 8.1 now shares the same idea. Completion of a property element has now become simpler than ever — just type a part of the property name inside the XAML object tag and invoke double completion, no type name of angle brackets required:

Completion of a XAML property element in ReSharper 8.1

Double completion of XAML attribute values now allows referencing currently available resources of applicable type in just a few steps:

Double completion of XAML attribute values

Windows 8.1 XAML Application Development Support

Speaking of resources, ReSharper 8.1 now is aware of the {ThemeResource} XAML concept introduced in Windows Store applications for Windows 8.1 to help with the theming of applications. Predictably enough, ReSharper now offers the features one would expect, such as Go to Declaration, Find Usages and refactorings (Rename, Inline, Extract) of these types of resource references:

Support for ThemeResource in Windows 8.1 applications

Import Types on Paste

Refactorings in ReSharper are even more beneficial when they monitor your editing activities and offer themselves opportunistically. For example, when you are reordering parameters of a method with copy & paste, using the Rearrange Code feature, or manually introducing new parameters or removing existing ones, ReSharper shows a dashed outline and suggests using the Change Signature refactoring to update usages of the method consistent with your changes:

Inline Change Signature refactoring

While previously ReSharper was able to detect inline renames of resources and x:Name fields declared in XAML, we are now extending this with the import types on paste feature. You can easily move parts of your XAML markup between files, and ReSharper will fix the type usages for you if required, introducing all the required namespace aliases to keep your code valid in its new location:

ReSharper offers to import types for pasted XAML code

File Structure Revisited

We are constantly looking for ways to improve our existing features to make them more useful. This is why the XAML code structure was rewritten from scratch, just like the JavaScript file structure support in ReSharper 8. Now it filters out unimportant things like namespace alias declarations, shows a preview of XAML attributes and tags’ inner values near the tree elements, collapses style setters for better readability, and a lot more:

Revisited File Structure window for XAML files

Typing Assistance

Another thing we did is we extended the small typing assistance feature called smart braces to support pair insertion and removal of XAML attribute quotes and markup extensions braces:

Smart braces for XAML attribute editing

It has become even more important to have this feature, as many developers prefer using the source code editor in Visual Studio to make XAML editing much more responsive. Unlike Visual Studio, ReSharper XAML typing assistance features work for both editors. The smart quotes feature is also available in the XML editor.

Some context actions have become so frequently used in XAML editing, that they became typing features. For example, in ReSharper 8.1, just by hitting the Enter key inside an empty attribute value, you can convert the attribute to a nested property element:

Smart Enter for XAML attribute to nested property conversion

Other Improvements

Every ReSharper release comes with lots of fixes in all the supported languages and functionality, and the release of 8.1 contains fixes for 50+ XAML-related issues. The list includes fixes for XAML 2009 support, support of .xoml files in the Microsoft Unified Communications SDK, and even special knowledge about WPF 4.5 binding to static properties (static events related to static properties are treated as used members):

Support for WPF 4.5 binding to static properties

So with that in mind, we hope you enjoy the new XAML support. To see it in action, download ReSharper 8.1 and give it a go.

Posted in ReSharper Tips&Tricks | Tagged , , , | Leave a comment

ReSharper 8.1 Goes RTM along with dotCover, dotTrace

We’ve just cooked a joint release of three .NET tools!

The following RTM builds are available for download: ReSharper 8.1, dotCover 2.6 and dotTrace Performance 5.5.3.

(Updates to ReSharper SDK, dotTrace SDK and ReSharper Command Line Tools are all available, too.)

Now let’s elaborate on why you’d want to download and install all this.

ReSharper 8.1

We’ve announced most highlights of ReSharper 8.1 in the EAP launch post back in October and in subsequent feature-specific posts but let’s walk through the changes briefly once again.

  • We’ve added support for TypeScript highlighted by refactorings (Rename, Introduce Variable), navigation, code completion, rearranging code (including a fancy concept of greedy brace) and code inspections such as detecting unused parameters and invalid CSS references. For details on all these features, please see an earlier post entitled TypeScript Support in ReSharper 8.1
  • We’ve improved integration into Visual Studio 2013 and fine-tuned it to work better with the RTM release of the IDE. Dedicated integration with the two leading editor features of Visual Studio 2013, Peek Definition and Enhanced Scroll Bar, is also there. For details, see Visual Studio 2013 Support in ReSharper 8.1.
  • We’ve added more C# code inspections revealing potentially severe runtime issues such as InvalidCastExceptions in foreach loops and infinite for loops.
  • Project Dependency View has received a huge set of enhancements such as analysis of indirect project relationships (possible paths), support for Undo/Redo, polished UI and new context menu items, as well as a performance boost. For details in this area, refer to Architecture Tools: Improvements in ReSharper 8.1.
  • Richer JavaScript support including Structural Search and Replace (SSR), as well as improvements in renaming and navigating between/to JavaScript symbols.
  • We’ve made XAML support more solid by supporting Windows 8.1 XAML apps, introducing double completion in property elements and resources, and adding more typing assistance actions such as “Import types on paste”. Stay tuned for more details in this regard.
  • Find Results and Inspection Results tool windows have been revised to consume less memory, as well as enable pinning and unpinning tabs.
  • Miscellaneous improvements such as a better standard of support for high DPI monitors, 400+ bug fixes and 70 performance fixes.

Note that not all ReSharper plugins are ready for 8.1 and if you’re using plugins, you’ll see update notifications from the Extension Manager as new updates become available. Specifically please make sure to update the bundled NuGet plugin as it has received an important fix after we compiled the release build of ReSharper.

dotCover 2.6 & dotTrace Performance 5.5.3

First of all, when it comes to dotCover and dotTrace Performance, you should get your hands on them if you use the tools in conjunction with ReSharper: both tools integrate with ReSharper 8.1. Same story if you need the tools in Visual Studio 2013 where they integrate as well.

One additional point in favor of the latest dotCover is that it includes an Extension Manager similar to the one introduced in ReSharper 8.0 several months ago. dotCover doesn’t have an extension ecosystem as strong as ReSharper but the Extension Manager is still a great time saver when it comes to updating to new versions of plug-ins:

Does all of that sound convincing enough?

If it does, please download ReSharper 8.1, dotCover 2.6 and dotTrace Performance 5.5.3.

In terms of license eligibility, here’s a way to check if your licenses will work with these updates:

  • ReSharper 8.1 is a free upgrade for all personal and academic licensees who are eligible for ReSharper 8.0. It’s also a free upgrade with all commercial per-major-version licenses to 8.x, and with commercial subscription-based licenses purchased or renewed on December 12, 2012 or later.
  • dotCover 2.6 is a free upgrade for all licensees who have purchased or renewed their licenses on December 12, 2012 or later.
  • dotTrace Performance 5.5.3 is a free upgrade for all dotTrace Performance 5 licensees.

If you’re still not sure about your license eligibility, there’s always an option to contact JetBrains sales for clarification.

Posted in News and Events | Tagged , , , , , , , | 11 Comments