What's New in ReSharper 6 - JetBrains

rouleaupromiseSecurity

Nov 5, 2013 (4 years and 9 days ago)

87 views

What’s New in ReSharper 6

ReSharper 6 is a major improvement over previous versions, bringing to the table support for
JavaScript, CSS, and Razor view engine; bundled decompiler; enhanced navigation; long
-
awaited
code analysis in VB.NET; and a lot more
exciting features.

Language support

................................
................................
................................
................................
................

2

JavaScript suppo
rt

................................
................................
................................
................................
...........

2

ASP.NET MVC 3 Razor support

................................
................................
................................
........................

3

CSS support

................................
................................
................................
................................
.....................

3

HTML support

................................
................................
................................
................................
..................

4

VB.NET code analysis

................................
................................
................................
................................
......

5

Improvem
ents in XAML support

................................
................................
................................
.....................

5

New and improved features

................................
................................
................................
...............................

6

Extended navigation and search

................................
................................
................................
.....................

6

Decompiler

................................
................................
................................
................................
......................

7

Multiple new code inspections

................................
................................
................................
.......................

8

Find similar issues
................................
................................
................................
................................
............

8

Converting

LINQ to loops

................................
................................
................................
................................

9

Color assistance

................................
................................
................................
................................
...............

9

ReSharper suggestions explained

................................
................................
................................
.................

10

New String.Format context actions
................................
................................
................................
...............

10

Import types for pasted code

................................
................................
................................
........................

10

In
-
place refactorings

................................
................................
................................
................................
.....

11

Improvements in unit testing

................................
................................
................................
........................

11

Searchable code inspection severity options

................................
................................
................................

12

Macros for file
headers

................................
................................
................................
................................
.

13




Language support

JavaScript support

JavaScript support spans most ReSharper 6 feature groups including code inspections, navigation,
refactorings, and coding assistance.

Extended code
completion in JavaScript

helps
filter out the enormity of JS library functions.


Navigation options in JavaScript include
File Structure

and
Go to File Member

for quick overview of
and browsing to file contents.

Find Usages

and
Highlight Usages

help track how JavaScript symbols
are used throughout the solution
:


JavaScript code formatting and naming style control
can be used
to adhere to organizational
coding
guidelines
. Also,
unit testing support
via
QUnit
framework is available
to assure the quality
of JavaScript code.

JavaScript support in
ReSharper
is available
wherever JavaScript is used, be it separate
.js

files,
inline script blocks in ASP.NET and HTML,
or function calls in markup element attributes.


ASP.NET MVC 3 Razor support

ReSharper's
existing
ASP.NET MVC feature pack is extended with support for the new Razor view
engine.

ReSharper brings its full power to C# code blocks in Razor views, including
code
highlighting, code completion, context actions, refactorings, and navigation.


ReSharper's navigation infrastructure, including
File Structure

and
Go to File Member
, works
correctly in
.cshtml

files.

Quick navigation between views, controllers, and actions works with Razor as efficiently as
with
ASPX
.
For example, w
hen returning a view from a controller action, view completion

is available:


CSS support

ReSharper applies its own highlighting to CSS sy
ntax. In addition, every color value is underlined
with the respective color, and a quick
-
fix is available to help change it using a graphical color
picker
:


U
sages of a CSS property or selector
can easily be found
both within the current file and in a la
rger
scope.

File Structure

and
Go to File Member

have also successfully arrived to CSS files,
letting instantly find
a property or any other CSS item even in a large file



all with
support for
lowerCamelHumps

search
:


ReSharper provides its own code comp
letion in CSS files and HTML/ASP.NET markup files. It helps
complete tag names and attributes, pseudo
-
classes, CSS properties and property values
:


In addition, ReSharper 6 introduces refactorings for CSS, such as
Rename

and
Extract Style
.

HTML support

ReSharper 6 brings basic HTML support to the table. First of all,
it provides
code completion for
tags, attributes and attribute values where applicable. This is especially handy for values of
class

and
id

attributes
where ReSharper brings up available CSS

properties and existing IDs:


We have also introduced a special kind of
Parameter Info

showing a quick overview of a given
HTML tag or attribute. The
Rename

refactoring for CSS classes and IDs can be invoked right from
HTML. Finally, we have
taken
a set of context actions
that have long been available in ASP.NET, and
made them ready to use
in
plain
HTML:


VB.NET code analysis

Visual Basic .NET support in ReSharper lacked on
-
the
-
fly code inspections for a couple of years, but
the wait is finally ove
r: VB.NET code analysis is making its first steps in ReSharper.

Highlighting for errors and code issues right in the text editor, ticks on the marker bar, inclusion of
VB.NET code issues in
Find Code Issues

and
Errors in Solution

tool windows: it's all
the
re
in
ReSharper 6!


Improvements in XAML support

Silverlight, WPF and Windows Phone 7 developers have a reason or two to like ReSharper 6. We
have introduced quick
-
fixes to create properties and dependency properties from usage, improved
code completion f
or bindings, and made ReSharper work nicely with
d:DataContext

and
d:DesignInstance

properties.


In other news, we have enabled Silverlight internationalization assistance in addition to the
previously supported WPF. Last but not least, there's no more
an
noying
duplicate code completion
in XAML files: pressing
Ctrl+Space

displays
either ReSharper or Visual St
udio IntelliSense but not
both.

New and improved features

Extended navigation and search

Navigation has been enhanced and extended in a multitude of ways. For example, when looking to
jump to a file,
a developer
can
now
narrow down the search by entering parts of a path to the file
using spaces as delimiters. This is super handy when hundreds
of similarly named files
exist in
Visual Studio
solution:


Go to File Member

has received a new option called
Include members from related files

that shows
members declared in files containing base
classes
and
other
derived types:


There's a new contextu
al navigation feature available for types: by calling the
Navigate To

menu
upon a type declaration or usage,
one
can easily get the list of extension methods for this type:


Another new contextual navigation feature is
Navigate to Parameter Declaration
. T
his is an
efficient substitute for
Go to Declaration

when dealing with multi
-
parameter methods: it lands on a
specific
method
parameter instead of a method name. That means no more lost focus while
scrolling to the
exact target
parameter
:


ReSharper 6 also adds a set of new filters in the
Find Results

window that
help
focus on specific
kinds of occurrences while searching for usages. For example,
when
searching for usages of a
method,
using
the new
Show Base Method Calls

filter
restricts
sea
rch results to calls to
the
method’s
base method:


Other new filters include
Unit Test Usages

to focus on usages of a symbol in test fixtures, and
Interface Qualifications

to filter out search results to usages of an interface in explicit
implementations
.

Decompiler

With ReSharper 6, a third
-
party decompiler
is not required
anymore! Decompile and navigate to
library code as easily as you navigate to source code. The entire ReSharper navigation
infrastructure, including
Go to Symbol/Type/File/File Member
,
File Structure
, navigating through
inheritance hierarchy and usage search, is available for decompiled code.

You can
navigate
to decompiled sources from anywhere, including from the source code,
Go to

windows, or
Object Browser
.


Note that we have also introduced a
standalone decompiler

called
dotPeek

that is available to
everyone, free of charge.

Multiple new code inspections

We have introduced tens of new on
-
the
-
fly code inspect
ions in ReSharper 6, all of which work in C#
code and the majority in VB.NET.

Prominent additions include
Possible multiple enumeration of IEnumerable

that is triggered when
ReSharper detects
excessive work looping through an enumerable:


Another inspecti
on that could save
any developer
an hour or two on debugging is
Return value of
pure method is not used
. It reminds when you're not assigning a return value of a method that
doesn't have any side effects:


Find similar issues

ReSharper 6 adds another pop
-
up menu item that displays on pressing
Alt+Enter

over highlighted
code.
This helps a developer
search for similar issues in the entire project, solution, or a folder. This
is a much more straightforward way to focus on a specific problem than before when
it required
searching for code issues in a scope

and carefully customizing filters.


Converting LINQ to loops

In ReSharper 5, we have introduced transformations from
for

and
foreach

loops to LINQ
statements.
ReSharper 6 completes the picture with context
actions to convert the
elegant query
language

to traditional loops
.


Color assistance

For everyone
working with color, be it in CSS, C#, VB.NET or XAML, ReSharper 6 provides color
highlighting for properties representing colors and code completion
visualizing colors and brushes:


In addition, a quick
-
fix is available
that displays a palette
to pick a color:


ReSharper suggestions explained

Sometimes, it's not outright clear why ReSharper highlights code in a particular way. However, it's
now easy
to get an explanation why ReSharper is coming up some of its most perplexing code
inspections: clicking
Why is ReSharper suggesting this

in the drop
-
down menu on pressing
Alt+Enter

opens a wiki page clarifying a particular inspection
:


New String.Format

context actions

In ReSharper 6, w
e have done a few things to help
developers

deal with format strings with less
friction. For instance, when the caret is on a format item, the item is highlighted along with its
corresponding object.
In addition
, a pack of

new context actions
are now available
to include and
exclude format items
:


What this essentially means is that
a developer
can enter
string.Format("")
, and add any
subsequent
format items with
Alt+Enter
!

Import types for pasted code

When an
external

piece of code gets pasted in

a file
, ReSharper 6 figures which import directives it
needs, and create
s

all of them with a single
Alt+Enter
:


In
-
place refactorings

ReSharper 6
allows
execut
ing

some of its most popular refactorings in a new way:
a develope
r
edit
s

code first, then appl
ies

a refactoring by pressing
Alt+Enter
. With
Rename
, this means you
modify a symbol declaration, press
Alt+Enter

and select
Apply Rename Refactoring

to spread the
change over all usages of the symbol.


We've also enabled
Change Signature

and
Move Static Members

to work this way. With the latter,
you just copy a static member, paste it in a target class, and apply the move by
pressing
Alt+Enter

upon this popup:


Improvements in unit testing

ReSharper's unit test runner has

received a great deal of improvements for this release. For
instance, it now provide
s

an error message
when a test run is launched but the
solution doesn't
compile. In terms of framework support, ReSharper 6 now detects NUnit test cases both in the
Unit
T
est Sessions

window and in the unit test pop
-
up menu:


In other news, we have introduced a set of default shortcuts for unit testing actions, and a new
action called
Repeat previous run

that lets re
-
run the most recent set of unit tests from any
position
in code.


Searchable code inspection severity options

Customizing inspection severity is now a lot easier, for several reasons. First of all, all code
inspections can now be configured to be shown with a particular level of severity, be it an error,
warni
ng, suggestion, or hint. Second, we have introduced several tabs in the
Options

dialog that
help manage inspection severity for a specific language or technology. Last but not least, you can
now search for specific inspections in the list, which is an enor
mous time saver
when
looking to
customize inspections
containing a particular keyword:


Macros for file headers

File headers that ReSharper applies on code cleanup can now contain macros defining things such
as solution, project and file name; current date and time; and file creation date and time. This
means
there’s no need
to manually update the file header ahead
of every
code
cleanup

run
.