Posts Tagged ‘ReSharper 7’

ReSharper 7.1.3 is Available for Visual Studio 2012 Update 2

Friday, April 12th, 2013

Have you upgraded Visual Studio 2012 to Update 2 RTM? If you have, please download ReSharper 7.1.3, which is mostly about compatibility with this new Visual Studio update.

Specifically, ReSharper can now successfully run MSTest fixtures in VS2012 Update 2 (this was the most important problem that has prevented usage of ReSharper 7.1.2 with VS2012 Update 2); adds support for Windows Phone 8 unit test projects; and becomes compatible with the final release of LightSwitch HTML Client as part of VS2012 Update 2.

To make things clearer, here are some easy rules specifying whether you need ReSharper 7.1.3 depending on the version of Visual Studio that you’re using:

  • Visual Studio 2005, 2008, or 2010: you don’t need ReSharper 7.1.3, skipping this update is a safe bet.
  • Visual Studio 2012 prior to Update 2: you should NOT install ReSharper 7.1.3 if you’re using MSTest.
  • Visual Studio 2012 Update 2: ReSharper 7.1.3 is primarily for you, so go ahead and download it.

Meet ReSharper 7.1.2, dotTrace 5.3.1 Performance

Wednesday, February 20th, 2013

Two quick maintenance releases to our .NET tools become available today: please download ReSharper 7.1.2 and dotTrace 5.3.1 Performance.

ReSharper 7.1.2 contains fixes to Find Usages (RSRP-336714) and auto-completion in XAML (RSRP-337050), brings a pack of unit testing improvements related to running MSTest fixtures in Visual Studio 2012 (here’s the list of fixes), and adds more updates to the installer.

dotTrace 5.3.1 Performance fixes fetching PDB files required for code preview (DTRC-8228), and improves installation in certain scenarios.

If you’re experiencing any of the issues mentioned above, please try out these new updates. However, if previous releases are working fine for you, it’s probably best to just stick with them.

dotTrace 5.3 Performance, ReSharper 7.1.1 are Available

Monday, December 17th, 2012

Rolling out updates to two .NET tools simultaneously is twice as fun: please download the shiny and new dotTrace 5.3 Performance for Visual Studio 2012 integration and Windows Store app profiling, and ReSharper 7.1.1 for bug fixes and performance improvements.

Major changes in dotTrace 5.3 Performance include:

  • The most requested and expected feature: integration with Visual Studio 2012. Prior versions of Visual Studio are still supported as well.
  • Integration with ReSharper 7.1 and 7.1.1.
  • Support for profiling Windows Store applications, including Windows Store test projects.
  • Profiling Windows Store applications with dotTrace Performance

  • New filters in Hot Spots view: “Filter system functions” and “Filter event-waiting trees”.
    New filters in Hot Spots view
  • A new measurement method: Thread Cycle Time, in addition to previously available Wall Time (CPU and performance counter) and Thread Time methods.
  • An updated Welcome screen that includes Attach To Process button and more cosmetic improvements for a comfortable profiling experience.
    Updated Welcome screen in dotTrace 5.3 Performance

dotTrace 5.3 Performance comes as a free upgrade for all dotTrace 5.0 Performance users, as well as for all dotTrace 4.x Performance customers who have purchased the product after February 23, 2012.

ReSharper 7.1.1 is a maintenance release that further refines performance and stability of the ReSharper 7.x family. Notable updates include:

  • Unit test runner enhancements related to debugging, inconclusive tests, and Unit Test Output window, among other fixes.
  • Bug fixes in the installation wizard, code formatter, IntelliSense, and Remove Unused References.
  • Miscellaneous performance improvements.

For further details, please see the entire list of fixes included in ReSharper 7.1.1.

ReSharper 7.1.1 is a free upgrade for all ReSharper 7.x users and also for ReSharper 6.x customers who have purchased their licenses on June 1, 2012 or later.

Please feel free to download and try dotTrace 5.3 Performance and ReSharper 7.1.1!

JavaScript Support Improvements in ReSharper 7.1

Tuesday, November 27th, 2012

Тhе JаvаSсriрt рrоgrаmming lаnguаgе соntinuеs tо risе in рорulаrity, sо аt JеtВrаins wе wоrk tirеlеssly tо bring аbоut mоrе аnd bеttеr suрроrt fоr this lаnguаgе. Неrе is аn оvеrviеw оf thе nеw things wе’vе gоt in stоrе fоr thе 7.1 rеlеаsе.

Vаluе Аnаlysis

Unlikе С# оr VВ.NЕТ, thе sеmаntiсs оf JаvаSсriрt ореrаtоrs аrе а vеry соmрliсаtеd аffаir, аnd thеir inсоrrесt usе саn lеаd tо vеry subtlе bugs. Luсkily, RеShаrреr’s gоt yоur bасk оn this. Неrе аrе а fеw ехаmрlеs оf vаluе аnаlysis thаt RеShаrреr реrfоrms tо рrеvеnt еrrоrs in yоur соdе.

Соnsidеr thе fоllоwing blосk оf соdе:

In thе аbоvе, RеShаrреr is smаrt еnоugh tо infеr thаt if tаrgеt is of а bооlеаn type then thе ехрrеssiоn if (tаrgеt) is аlwаys truе. Аs а rеsult, соdе in thе еlsе blосk is grаyеd-оut аnd indiсаtеd аs bеing unrеасhаblе.

In а similаr fаshiоn, thе аbоvе соdе hаs а rереаtеd if blосk (роssibly duе tо а сорy-раstе еrrоr), аnd RеShаrреr рiсks uр оn this, highlighting thе соnditiоn аnd grаying оut thе hеuristiсаlly unrеасhаblе соdе.

Неrе is аnоthеr ехаmрlе оf аn if stаtеmеnt thаt’s nоt nееdеd:

Аnd аnоthеr оnе, bаsеd оn thе аnаlysis оf thе аrgumеnt tyре:

Аnd finаlly, hеrе’s аn illustrаtiоn оf а саsе whеrе а сhесk аgаinst undеfinеd mаy nоt bе еnоugh:

Соdе Соmрlеtiоn Imрrоvеmеnts

RеShаrреr соntinuеs tо аugmеnt its соdе соmрlеtiоn сараbilitiеs. Fоr ехаmрlе, if yоu stаrt сhесking thе tyре оf а раrtiсulаr vаluе, yоu wоuld gеt thе fоllоwing соmрlеtiоn list:

Соmрlеtiоn lists fоr JаvаSсriрt tyреs nоw shоw аll mеmbеrs, but thе mоst rеlеvаnt mеmbеrs fоr thе givеn tyре (аs infеrrеd by RеShаrреr) арреаr in bоld аnd nеаr thе tор оf thе list:

Аbbrеviаtiоns

Аnd оnе lаst thing… RеShаrреr nоw suрроrts аbbrеviаtiоns in JаvаSсriрt just аs it dоеs in оthеr lаnguаgеs:

Wе hоре yоu еnjоy thеsе fеаturеs. Stаy tunеd fоr mоrе!

ReSharper 7.1 Plugins

Friday, November 23rd, 2012

ReSharper 7.1 has only just been released, and once again, it’s time to congratulate our plugin authors on how quickly they have support for the latest version ready. A lot of these plugins are Open Source, and produced in the authors’ spare time, so we’d like to give them a big thank you for their continued support. Here are some of the plugins:

  • We have testing frameworks: AgUnit can run and debug Silverlight tests, the xunitcontrib runner provides xUnit.net support and the latest MSpec NuGet package includes a ReSharper 7.1 runner.
  • There are code validation plug-ins: StyleCop will analyse your C# source code, and display warnings and corrections if you violate the style guide. JSLint for ReSharper supplies similar functionality for your JavaScript files.
  • There are a couple of plugins providing spell checker support. YouCantSpell is available now, ReSpeller is currently being updated and should be available very soon, and Agent Smith implements context actions to help format XML documentation as well as spell checking.
  • ActiveMesa’s R2P plugin brings a veritable smorgasbord of miscellaneous context actions, refactorings, generators and and inspections to ReSharper 7.1, as does Agent Johnson.
  • Catel.ReSharper takes a very interesting approach to implementing a plugin – instead of offering a broad set of additional features, it targets users of a specific platform - that is Catel MVVM project, providing context actions and refactorings specifically designed to integrate with the Catel.MVVM feature set.
  • The GammaXaml plugin has been updated to work with the new XAML support in 7.1, and provides additional XAML support such as dependency property validation and generation, and support for Caliburn.Micro’s conventions.
  • Joar Øyen’s ReSharperExtensions is a set of macros to be used in live templates, where they can automatically insert the current domain user or ensure a string typed by the user is a valid identifier by converting spaces to underscores, optionally capitalising the first letter of each word.
  • Continuing the Agent naming theme, Agent Mulder brings ReSharper analysis and navigation features to Dependency Injection frameworks such as Autofac and Castle Windsor. It’s not quite ready for 7.1 yet, but it’s being worked on and should be available soon.
  • And of course, there are plugins that JetBrains contributes. The recently released NuGet support, and the example plugin that shows MVC action verbs in navigation lists both support ReSharper 7.1.

Again, most of these plugins are Open Source. All of the authors welcome feedback, good as well as bad! Report issues, suggest features, fork and contribute! If you want to get involved, download the SDK for MSBuild targets, tools and sample code, and visit the development guide for more information. And if you create a new plugin, let us know, and we’ll help spread the word.

ReSharper 7.1 is Available

Tuesday, November 13th, 2012

ReSharper 7.1 is released
You knew ReSharper 7.1 had been underway for some time, and now, the day has come: ReSharper 7.1 is officially released and available for download. You’re welcome to grab the new ReSharper update.

Some of the reasons why you would want to do this include:

  • Performance and bug fixes: since releasing version 7.0, we have fixed over 300 performance problems and bugs! Special notice goes to performance fixes for SharePoint and ASP.NET MVC projects, as well as those for resource files.
  • Improved code formatter: considering that code formatting is a very sensitive area of functionality, we have implemented some of the most demanded code formatter improvements so far. For example, ReSharper 7.1 is able to format XML doc comments and chained method calls. We’ve recently blogged in detail about code formatter improvements.
  • Reviewing code and sharing ReSharper code inspection results with team mates is now easier, thanks to improved export functionality, as well as a way to copy code inspection items and convert them to work items. To learn more about this, see Easy sharing of ReSharper inspection results in the 7.1 EAP launch blog post.
  • Support for Windows Phone 8: if you’re already using Windows Phone 8 SDK to develop applications, ReSharper 7.1 is here to help you. How exactly? Read a recent blog post about Windows Phone 8 support
  • Support for VB.NET has been refined with Extract Class refactoring, new quick-fixes and improved IntelliSense.
  • XAML support is now considerably smoother in terms of code completion, typing assistance, naming style control, and code generation. The guy who’s in charge of XAML support has recently blogged about this.
  • INotifyPropertyChanged support pack now covers more usage scenarios relevant to Windows Forms, WPF and Silverlight application developers.
  • Other improvements include fixes in multiple refactorings; improved support for Entity Framework 5, ASP.NET, ASP.NET MVC, and JavaScript.

ReSharper 7.1 is a free upgrade for everyone who owns a ReSharper 7 license or a ReSharper 6 license purchased since June 1, 2012.

If you’re using ReSharper with plug-ins, they’re being tested for 7.1 compatibility. Most of them should be available for download in the coming days.

Please download ReSharper 7.1 and let us know how it works for you!

Code Formatting Improvements in ReSharper 7.1

Monday, November 12th, 2012

Code formatting is, and will always remain, a sensitive subject: with many companies having their own specific standards, it’s very difficult to please everyone. In ReSharper 7.1, we’ve taken another shot at smoothing out the formatting experience with more options and settings, many of which were requested by our customers.

Aligning Multiline Constructs

It has long been an issue that long method calls, whether it be in fluent interfaces or LINQ, resulted in code that looked less than agreeable. What we’ve done to remedy this is added two options to control the way long method calls are wrapped.

The first option is one to Wrap chained method calls:

The three supported options are as follows:

  • Chop always, as its name suggests, ensures that chain method calls are always split up on the period operator.
  • Simple wrap wraps method calls when the maximum line length has been reached. Multiple chained calls can appear on a single line.
  • Chop if long wraps method calls when the maximum line length of the call chain has been reached, with each of the calls appearing on a separate line.

ReSharper also has an option called Prefer wrap after “.” in method calls just in case you want parts of the chain to always end with the dot rather than start with one:

Whether or not the methods are actually aligned on the dot is controlled by yet another option under Other|Align Multiline Constructs called Chained method calls. Turning this off causes the wrapped line to be indented instead of dot-aligned:

XML and XML Comment Formatting

In ReSharper 7.1, XML formatting options have had a bit of a redesign. Also, we’ve given XML Doc Comments a separate category, so you can now control the two independently.

Broadly speaking, the formatting style of both ordinary XML and XML Doc Comments is supported via the following categories:

  • Line wrapping determines how XML entities are wrapped.
  • Processing instructions can also be formatted according to a set of rules.
  • Elements that are Inside of tag header (i.e., attributes and spacing between them) can also be controlled. For example, you can determine if there’s a space after the last attribute, or whether attributes on new lines are indented or not.
  • Tag content settings determine what happens to text that’s placed between various XML tags. You can control wrapping, line breaks and indentation.
  • Finally, settings for elements Around tags determine if and when tags get placed on a separate line. XML Doc Comments also have a setting that lets you specify tags that are always placed on a separate line regardless of the overall settings — handy if you want tags like <summary> to always occupy a separate line.

Wе’vе mаdе RеShаrреr асt а littlе lеss аggrеssivе with rеsресt tо yоur linе brеаks, choosing to respect them where it makes sense. If for some reason you prefer the old behavior, you will need to navigate to XML | Formatting Style in ReSharper’s options and:

  • Set the value in Tag content | Line breaks after header and before footer when tag is longer then to 20
  • Set the value the Attributes format to ‘On single line’ under both the Inside of tag header and Processing Instructions headings
  • Set the check box in Around tags | Place singleline tags on new line

Alignment and Indentation Improvements

Many users have corporate policies that are very strict with regard to tabs and spaces that are used for both indentation and alignment. To provide a better experience for our users, we have introduced two options that impact the way indentation is carried out:

The first of these options concerns indentation in multi-language files. You can have ReSharper use a global indentation setting for every type of additional language that’s being used in a multi-language file; or, alternatively, you can indent each language using its own settings as specified in ReSharper’s options under Code Editing | [Language] | Formatting Style.

The second setting concerns the uses of tabs. If the ‘Keep tabs’ option is selected under Visual Studio’s Options (under Text Editor | All Languages | Tabs), these settings determine how tabs are used for indentation and alignment. The options are as follows:

  • Use spaces — this tells ReSharper use tabs for indentation and spaces for alignment.
  • Use only tabs only uses tabs for alignment, which may cause misalignment in case a block of code does not fall on a tab boundary.
  • Mix tabs and spaces for optimal fill uses a combination of tabs and spaces for precisely aligning code.

Web Formatting Improvements

By popular demand, we have added a setting for ASP.NET and Razor projects, so you can use the K&R brace style in ASP.NET while continuing to use the BSD style in C#:

We’ve also added several options to the JavaScript formatter. Specifically, we’ve added options for specifying brace layout for functions passed as parameters into other functions, and have added an option to indent object literals, arrays and nested expressions. Additionally, we’ve introduced an option to add an empty space in braces inside an object expression.

Also, as previously mentioned, web languages can now elect whether or not to use the indentation settings of their parent file. This means that a block of C# code embedded in an HTML file can either use the C# settings or the HTML settings depending on the chosen option.

Odds and Ends

For all fans of the K&R brace style, we’ve added several new settings concerning the rules for inserting blank lines in code:

We’ve also added some options for specifying whether or not attributes should be placed on the same line as single- and multi-line property accessors:

And finally, we’ve put in extra work on proper splitting up of compound conditions in if, while and do statements:

It’s all you!

Most of the features described here have been implemented based on user feedback, for which we thank you! If there’s something else that you find missing, please let us now by posting your use case on our issue tracker.

If you’re impatient to try out these and other improvements, download ReSharper 7.1 nightly builds.

Windows Phone 8 Support in ReSharper 7.1

Wednesday, October 31st, 2012

As many of you know, after months of waiting Microsoft has finally released Windows Phone 8 SDK to the general public. This means that you can now start writing WP8 apps and it should probably come as no surprise that ReSharper is here to help once again!

Here is an overview of some of the aspects of WP8 development that ReSharper 7.1 supports out of the box:

  • Code completion is provided in both the C# and VB languages as well as XAML.

  • Code inspections, quick-fixes and context actions let you quickly fix errors, improve and organize your code:

  • A vast array of XAML-related improvements is provided in 7.1. These include improved support for XAML code completion as well as typing assistance, binding assistance, support for custom bindings and resource dictionaries and lots of other improvements. Check out this blog post for details.

  • Navigation and search mechanisms continue to support lightning-fast introspection of existing code:

  • Create from usage mechanisms let you use elements first, and declare them later:

  • ReSharper’s large set of refactorings support different languages as well as cross-language usage scenarios:

  • Color highlighting and the Select Color window make working with colors in XAML a breeze:

  • Naturally, ReSharper also supports HTML that is used in the “Windows Phone HTML5 App” type of project:

We’ve ensured that all of the aforementioned mechanisms (as well as many others) are supported under the various C#- and VB.NET-based Windows Phone project types, making development of WP8 applications that much easier and more intuitive. Enjoy!

Right now, you can download a fresh ReSharper 7.1 nightly build. The final release should be available shortly as well.

XAML Support Refresh in ReSharper 7.1

Monday, October 22nd, 2012

Just so you know, we’re continuously trying to improve the coding experience of everyone who works with XAML. ReSharper 7.0 that we have released a couple of months ago was highly focused on supporting Windows Store application development and quite frankly, didn’t contain many changes targeted at a broader crowd of XAML pros. Come 7.1, it’s time to make everyone happier, even if you’re not very much into Windows Store apps right now.

Code completion

The main challenge that we’ve solved in ReSharper 7.1 was to come up with fast, smooth and smart automatic code completion in XAML markup. Providing code completion lists in XAML is sometimes a non-trivial task: for example, WPF actually exposes hundreds of public types with lots of members like attached properties and events that should be taken into account while building completion lists. By virtue of reviewing our caching strategies in ReSharper 7.1, we ended up with a nice performance boost in code completion and whole XAML support as well.

Automatic completion by design drops many possible types that you can possibly use to qualify properties in XAML markup and includes only types that can bear a meaning in the current context:

If you’re looking for the full list of possible types with attached properties/events, just invoke symbol completion (Ctrl + Space). This behavior differs from that used in other languages where automatic completion works pretty much the same as symbol completion. However, it makes XAML lookups much cleaner and more precise in most cases. If you happen to find this behavior confusing, please vote or leave a comment under this issue.

Property completion in XAML now highlights a type’s own properties with bold, helping identify control-specific properties among thousands of those inherited from framework classes:

When generating completion lists for markup extensions, ReSharper can now filter out properties that you have already set:

An action to generate event handlers is now available with both automatic and symbol code completion:

If invoked inside an empty x:Name attribute, symbol code completion now suggests name options derived from control type name. If you’re providing a prefix for the new name, it still works as expected:

Automatic code completion is getting much more useful when dealing with resources: completion list is filtered based on expected resource type:

Field modifiers in Windows Store applications are now correctly handled and completion list now includes the previously missing protected modifier:

Different icons help identify markup extensions when using object element syntax:

Automatic closing tag code completion in all XML-based languages now only shows tags that are actually not closed:

A plethora of other small improvements has been implemented in code completion for XAML, including fixes in the calculation of expected types and improvements in Windows Workflow Foundation (WF) projects. As expected, XAML code completion in ReSharper reacts to type changes immediately, without requiring to build your project.

Typing assistance

The second important area that has been improved for XAML developers is typing assistance.
ReSharper 7.1 introduces some really nice bits of HTML editing experience to XML-based formats (including XAML, web.config, MSBuild scripts and all other kinds of XML documents) — for example, synchronous tag editing:

A feature called smart slash helps create self-closing tags by automatically removing the closing tag and placing the caret after the new tag for you (and also removing any white space that could have left between the converted pair of tags):

In order to prevent code completion from getting in your way, it should be able to detect when you’re trying to enter characters that had already been completed for you. In the case below, ReSharper auto-completes the closing angle bracket of the opening tag, as well as the entire closing tag. Meanwhile, if you’ve not looking at the screen and proceed to entering the closing angle bracket yourself, ReSharper simply merges the two brackets to prevent duplication:

Binding assistance

One of the greatest benefits of using ReSharper with XAML is static typing of data bindings. When ReSharper knows the binding source type it offers you a lot of opportunities: navigation directly to bound properties, code completion for property paths, refactoring support, error validation, and more. Static typing increases maintainability of your XAML markup, especially in applications with heavy usage of bindings (like MVVM-based apps.)

ReSharper is trying to infer the type of binding source in many ways (like in the screenshot above) but in cases where it’s not possible, there’s an easy way to annotate the data context type with design-level annotations, now using a submenu:

Such annotations are usually only required at the top level of XAML element trees. ReSharper 7.0 is trying to utilize the property name you have already typed and suggest a smart choice:

If the suggested type doesn’t fit, you can trigger import completion or enter a new type that can then be declared from usage.

ReSharper 7.1 offers new ways to infer binding source type. One popular scenario that is now supported involves binding through the DataContext property of another named control element. ReSharper can now share information about data context type between different controls:

ReSharper provides code completion and other features despite <DataContext property being of System.Object type. Similar bindings with RelativeSource mode are also supported.

If you are using custom markup extensions as binding source, ReSharper 7.1 can now calculate data context type from [MarkupExtensionReturnType] annotation in WPF (or implementation of IMarkupExtension<T> interface in Silverlight 5):

Binding type calculation also deals with CollectionViewSource in ReSharper 7.1 with respect to design-level attributes like d:DesignSource. Finally, ReSharper 7.1 introduces support for IValueConverter annotated with [ValueConversion] attribute:

Naming consistency

ReSharper 7.1 now highlights naming consistency issues in XAML markup just like in other supported languages and offers actions to fix naming. Naming rules are configurable for XAML fields, resources and namespace aliases.

Create from usage

ReSharper’s Create from usage family of quick-fixes can be very useful during development of custom controls or building custom object structures in XAML markup. ReSharper 7.1 knows a lot about all the types that you are using inside markup and improves actions like Create type and Create property with calculation of expected types — similar to how it does in C# and VB.NET:

You can specify a resource for a non-existing property, use nested object element like in the example above or even bind the property to something — ReSharper 7.1 will suggest the correct type for the new property when it creates it from your usage:

Custom bindings and resource dictionaries

ReSharper 7.1 introduces basic support for custom resource dictionaries and binding extensions. Custom structures are currently detected via naming conventions. Inheritors of ResourceDictionary type should be named using “ResourceDictionary” suffix in order to be correctly handled by ReSharper in XAML markup and participate in resource resolution:

There’s a similar story with custom bindings: you should use “Binding” suffix to enable ReSharper support for your custom markup extensions that complement XAML binding capabilities:

In future versions, we’ll be looking to provide adequate tooling without enforcing any particular naming conventions.

Other fixes

We’ve also implemented a number of miscellaneous XAML support fixes including (but not limited to) the following:

  • Suppressing inspections with comment now works everywhere in XML documents (including XAML, web.config.)
  • Color boxes in code completion and color usage highlightings are back in Silverlight and WinRT projects (both in XAML markup and code-behind files.)
  • Unused XAML resources are no longer highlighted with gray in their entirety: only resource keys are highlighted.
  • Support for markup extensions has been rewritten to solve a bunch of issues and provide improved code completion.

Here’s the full list of XAML-related fixes implemented for ReSharper 7.1 this far, and we still have quite a bit on our XAML support improvement agenda.

As usual, any feedback on your experience with ReSharper XAML support is highly appreciated! To test drive the recent changes, make sure to download a fresh ReSharper 7.1 EAP build.

12,571 Miles to Build 2012

Friday, October 19th, 2012

Meet Hadi Hariri, Matt Ellis and Brian Noll at the sold out Build 2012 event, October 30 – November 2, 2012 at the Microsoft Campus in Redmond, Washington.

Windows 8 is on the plate and if you stop by our booth, we will show you how ReSharper 7 makes for easier development of Windows Store apps.

We look forward to meeting you there!