ReSharper Ultimate 2016.2.1 is available

We have just published a bug fix update to ReSharper Ultimate 2016.2.

This release contains a fine selection of 70 hand-picked bug fixes across ReSharper, ReSharper C++ and dotCover.

Please download and enjoy ReSharper Ultimate 2016.2.1!

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

ReSharper Ultimate 2016.2: video and code samples

We have released ReSharper Ultimate 2016.2 last week, which introduced a whole lot of updates across ReSharper, ReSharper C++ and dotPeek, as well as a bunch of fixes and improvements in dotTrace, dotCover, and dotMemory.

In case you feel that reading a multi-screen list of what’s new is too daunting, our old friend Hadi Hariri has come up with an under-10-minutes summary video:

In the video, Hadi uses a lot of code samples from a special repository that we maintain in order to illustrate changes in new ReSharper Ultimate versions in a very code-centric way.

If you like to learn what’s new in the latest ReSharper by playing with code that exposes the recent improvements, go ahead and clone this repository, which you can navigate using ReSharper’s own To-do Explorer.

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

ReSharper Ultimate 2016.2 is here!

We at JetBrains have just finalized an update to the ReSharper Ultimate family, and we welcome you to download ReSharper Ultimate 2016.2 RTM!
ReSharper 2016.2 is released
Read on for the main highlights of this release:

ReSharper

In addition to 750+ fixes, major highlights of ReSharper 2016.2 are the following:

  • Support for ASP.NET Core 1.0 and .NET Core 1.0 projects, which means that ReSharper now correctly resolves project references and provides its core set of features (code inspections, code completion, navigation, search and refactorings) in projects of this type. Please note that unit testing is not yet supported .NET Core projects. This is going to be addressed in upcoming updates.ASP.NET Core support
  • Structural navigation, a new feature informally referred to as “Make Tab Great Again”. You can now use Tab and Shift+Tab keys to quickly move the text selection to the next or previous code element without having to use the cursor keys, letting you quickly navigate to the next important piece of code you need to edit.
    Structural Navigation in ReSharper 2016.2
    Tab will certainly continue to handle template expansion, and will also indent (and Shift+Tab will outdent) when the text caret is placed at the start of a line. However, when the text caret is within a code element, Tab and Shift+Tab will start navigating and selecting the structure of your code. You can change this behavior in ReSharper options anytime.
  • Go to Text navigation (Ctrl+T,T,T) lets you quickly find and navigate to any text in source and textual files. This new feature uses trigram indexing to make text search blazingly fast. Similar to other navigation commands, if there are too many matching items you can hit + on the numeric keypad to explore results in the Find Results window.
    Go to Text command in ReSharper 2016.2
  • Warnings in solution-wide analysis help you constantly keep track of all warnings in your solution: both actual compiler warnings and ReSharper’s inspections with the Warning severity level. The status bar indicator can now stay orange while there are unresolved warnings. It is still up to you whether to enable the solution-wide analysis and whether to include warnings into it: just right-click the status bar indicator to configure everything to your liking.
    Warnings in solution-wide analysis
  • Marking references as used at runtime to exclude them from code cleanup performed by the Optimize References and Remove Unused References features.
  • New C# typing assistant features, such as auto-replacing MethodName(.) with MethodName()., and correcting mistyped @$ prefixes for verbatim string interpolations.

  • Rearrange code improvements. For example, it is now available in interpolated string inserts, and in expressions with 3 and more operands; Greedy brace feature now works for opening brace, braces of types and namespace declarations.
  • Reworked surround templates. If you need to surround a piece of code with a template, just select the code, and type in the name of a template you need: no extra shortcuts required. In other news, a single template can now be used for for creating code (as a live template) and for surrounding existing code (as a surround template).
    Surround templates in completion lists
  • A new refactoring to move members to another part of a class. You can also use the refactoring over a region to move all region members into a new file with a name inferred from the region name.
  • New quick-fixes and context actions that help simplify string interpolation inserts, revert the order of iteration in simple for loops, or fix awaiting of a void method by making it return Task. (By the way, existing quick-fixes that make methods async now suggest using Task instead of void.) In other news, you can now check all parameters of a method for null (or empty strings) with a single context action. You can even uncomment or even delete a comment via Alt+Enter. Context action to add guard clauses for all arguments at once
  • Assembly dependency diagram that visualizes how assemblies are interrelated via references.
  • HTML analysis inside string literals in .cs, .js, and .ts files, which can be enabled with the context action or with a comment /*language=html*/ ahead of a string literal. You can now use the Mark HTML here action to enjoy syntax highlighting, error detection and other HTML goodies right inside the string literal.
  • Regular expression assistance in string literals can now also be enabled with a comment /*language=regexp|jsregexp*/ before the string literal. Language injection with comments
  • JSON value helpers allow you to tell ReSharper to provide code completion or validation for your own JSON files. You can add a helper in the JSON Value Helpers options page, matching based on a filename mask and/or schema match. Custom JSON schema catalogs can also be added in JSON options. These can be either a file, or a URL, which will be downloaded in the background, and periodically updated. JSON value helpers
  • Support for the <inheritdoc/> tag in XML documentation comments, which is a good alternative to copying documentation from base types/members to derivatives.
  • C# formatter improvements: new options for indenting of parentheses and code inside them; for controlling spaces before and after ++ and -- operators as well as before and inside parenthesis of checked and default expressions.
  • Improved IL Viewer: types, members, type parameters, local variables, etc. are contextually highlighted; loops in your code can be distinguished by indents and comments. IL viewer with highlighting and formatted loops
  • String interpolation suggestions, quick-fixes and context actions are now available for VB.NET. Context actions to convert a string literal to an interpolated string, or insert an interpolated argument are here as well.Concatenation to interpolation in VB.NET
  • Improved CSS support: ReSharper’s code inspections, code completion, navigation, search and refactorings are now also available for CSS variables. In addition, several fixes for better spec handling are introduced. CSS variables support in ReSharper 2016.2
  • Extended TypeScript/JavaScript support including:
    • Generating code with code completion in TypeScript (ctorf/ctorp, overrides, lambdas).
    • Improved Find Usages and Rename for union and intersection types.
    • Full support of TypeScript 2.0.0 features, including this for functions, control flow aware type guards, path mappings, optional class members, the never type.
    • If you have an abstract class implementing an interface, you can now generate missing members abstract, using the Generate action (Alt+Insert) or a quick-fix.
    • Go to Declaration and Find Usages work correctly when dealing with type aliases.
  • The Process Explorer window (ReSharper | Windows | Process Explorer), which was previously only available in dotPeek, provides you with the list of currently running processes, allows exploring their modules and decompiling those that are .NET assemblies.
    Process Explorer window in ReSharper 2016.2

ReSharper C++

ReSharper C++ 2016.2 comes with 200+ fixes and a set of larger improvements:

  • Inline Variable Refactoring is now available in ReSharper C++.Inline Variable refactoring for cpp
  • Quick Documentation pop-up appears in ReSharper C++ 2016.2. It can display documentation from Doxygen comment blocks, and even if there is no Doxygen documentation for a symbol, it will display the symbol signature. Quick documentation popup in ReSharper C++
  • New code inspections and quick-fixes: There is a new code inspection that warns you about missing include guards in your header files. As a quick-fix, it lets you automatically add #pragma once directive. Another new inspection detects a missing default case in a switch statement with a corresponding fix to add it.
  • Warnings about usages of classes and functions marked with the [[deprecated]]/__declspec(deprecated) attribute. ReSharper showing highlight for deprecated C++ code
  • Improved C++14 support: variable templates and decltype(auto).
  • Support of the [[noreturn]]/__declspec(noreturn) attribute in control flow analysis.
  • New code style preferences for #include directives in generated code.
  • Code style for default pointer initializer. You can specify 0, nullptr or NULL as the preferred initializer in the options, and ReSharper C++ will use it in generated initializers.
  • Automatic completion in C++ can now suggest symbols that are not included in the current file. The corresponding #include directives are added automatically.Import suggestions in C++ auto-completion
  • You can now generate documentation comments for C++ declarators, classes and macro definitions with a context action. The comment stub can be customized by editing the ‘doc’ live template that ReSharper uses for generation.
  • When your caret is on one of the exit points of a function/loop/switch (return, throw etc.), ReSharper C++ will automatically highlight all other exit points.
  • New formatter settings for single-line functions and lambdas, blank lines around single line function definitions, line breaks before member initializer list, and space between closing angle brackets in template arguments (for conformance with pre-C++11 compilers).
  • The mock function generator now supports the Trompeloeil framework.
  • Completion, usage search and rename of symbols in Doxygen comments.
  • __RESHARPER__ macro that allows you to detect when ReSharper is parsing your source code and, if necessary, disable ReSharper’s preprocessor for some code.
  • Performance improvements in indexing and code analysis.

Other ReSharper Ultimate tools have received their shares of improvement as well.

dotCover

  • dotCover 2016.2 lets you exclude auto-properties from coverage analysis with Hide auto-properties option.
  • Filtering processes from console runner allows you reduce unnecessary overhead by excluding child processes that are irrelevant to the coverage analysis. To enable a process filter, use the /ProcessFilters parameter. For example, /ProcessFilters=+:prA;+prB will exclude all processes except prA and prB; /ProcessFilters=-:prC will exclude prC from the coverage.

dotTrace

Recursive call stacks can be deep and difficult to analyze. Previously, Timeline Viewer would show call stacks “as is”, i.e recursive calls were simply shown as they were called: one after another in the stack trace, which would lead to long scrolling. With dotTrace 2016.2 Timeline Viewer, you can easily fold such calls to streamline stack analysis.Recursive call stack in dotTrace Timeline Viewer 2016.2

dotMemory

dotMemory now allows you to compare memory snapshots stored in different workspaces: that is, collected in different profiling sessions. This can be useful to check how particular changes in code affect your application’s memory usage. All you need are two snapshots taken before and after making the changes.
Cross-workspace snapshots comparison in dotMemory 2016.2
For the full list of fixes in dotMemory 2016.2 please refer to release notes.

dotPeek

  • With dotPeek 2016.2, the IL Viewer displays code in a more readable manner: types, members, type parameters and local variables are contextually highlighted; loops in your code can be distinguished by indents and comments.
  • dotPeek 2016.2 adds Assembly Dependency Diagram to the existing visual dependency analysis tools. You can invoke it on assemblies selected in the Assembly Explorer and explore how the assemblies are referencing each other. Assembly_Hierarchy

Licensing

If you have an active subscription for ReSharper, ReSharper C++ or ReSharper Ultimate, we encourage you to start using 2016.2 straight away.

As we have just recently switched to subscription licensing, some of you may still use older, pre-subscription licenses. If you are not sure whether your licenses are eligible to use with 2016.2, or if you need a formal quote or any other assistance, please get in touch with JetBrains sales anytime.


Get ReSharper Ultimate 2016.2

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

ReSharper Ultimate 2016.2 Release Candidate

Ladies and gentlemen, you can now download ReSharper Ultimate 2016.2 Release Candidate!

All new features and improvements that we have revealed and blogged about in recent months are now in pre-final state.

This includes things as exciting as textual search via Go to Text, structural navigation with Tab, and warnings in solution-wide analysis, as well as more mundane fixes, of which there are plenty.

If you still have pressing issues with 2016.2 RC or if something that we assume fixed doesn’t actually solve your issues (btw, everyone who has been unhappy about Move to Folder behavior with TFS, we’re waiting for you to confirm a fix), this is probably your last chance to let us know via comments here, or better yet, via issues in respective product trackers: ReSharper, ReSharper C++, dotTrace, dotMemory, dotPeek or dotCover.

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

ReSharper Ultimate 2016.2 EAP: What’s new in builds 9-11

ReSharper Ultimate 2016.2 EAP has been open for over two months, and we are approaching release now. Most probably, the new things described below will round up the feature set of upcoming ReSharper Ultimate 2016.2. So here is what’s new in the latest EAP builds.

ReSharper

In addition to 100+ fixed issues in the mainline ReSharper, there are some new features worth mentioning:

  • Go to Text navigation (Ctrl+T,T,T) lets you quickly find and navigate to any text in source and textual files. This new feature uses trigram indexing to make text search blazingly fast. Similar to other navigation commands, if there are too many matching items you can hit + on the numeric keypad to explore results in the Find Results window.
    Go to Text command
  • Warnings in solution-wide analysis will help you constantly keep track of all warnings in your solution: both actual compiler warnings and ReSharper’s inspections with the ‘Warning’ severity level. Before, the status bar indicator would turn green as soon as the last error in the solution was fixed. Now, the indicator can stay orange while there are unresolved warnings. It is still up to you whether to enable the solution-wide analysis and whether to include warnings in it: just right-click the status bar indicator to configure everything.
    Warnings in solution-wide analysis
  • A way to propagate XML documentation with the <inheritdoc/> tag, which is a good alternative to copying documentation from base types/members to derivatives. Although the tag is non-standard, it is understood by tools such as NDoc, Sandcastle, and Stylecop; and there are also requests to support it in .NET Core and Roslyn.
    So you can now use a context action to add the <inheritdoc/> comment to derived members; you can enable adding <inheritdoc/> automatically when generating missing/overriding members; the Quick Documentation popup will display the correct documentation even if the tag explicitly refers to specific symbol, i.e. <inheritdoc cref="SomeSymbol"/>.
  • The Process Explorer window (ReSharper | Windows | Process Explorer), which was previously only available in dotPeek, provides you with the list of currently running processes, allows exploring their modules and decompiling those of them that are .NET assemblies.
    Process Explorer window
  • New formatter options that let you control spaces before and after ++ and -- operators as well as spaces before and inside parenthesis of checked and default expressions.
  • In terms of TypeScript, ReSharper now fully supports TypeScript 2.0. Another long awaited feature makes the main navigation commands (Go to Declaration and Find Usages) work correctly when dealing with type aliases.

ReSharper C++

  • You can now generate documentation comments for C++ symbols simply with a context action. If necessary, you can customize the comment stub by editing the ‘doc’ live template that ReSharper uses for generation.
    Surround templates in completion lists
  • When your caret is on one of a function’s exits (return, throw, etc.) ReSharper C++ will automatically highlight all other function exits including exits from loops and switch statements.
  • New code inspections and quick-fixes: ‘Missing default case in a switch statement’ and ‘Non-explicit conversion operator’
  • Code style for default pointer initializer. You can specify 0, nullptr or NULL as the preferred initializer in the options, and ReSharper will help you maintain this style in your code base.

dotTrace

Recursive call stacks can be deep and difficult to analyze. Previously, Timeline Viewer would show call stacks “as is”, i.e recursive calls were simply shown as they were called: one after another in the stack trace. Of course, on complex call stacks with multiple recursive calls this would result in almost infinite stack scrolling. Now, Timeline Viewer allows you to fold such calls to streamline stack analysis.

Recursive call stack in dotTrace Timeline Viewer 2016.2

dotMemory

dotMemory now allows you to compare memory snapshots stored in different workspaces, or, in other words, collected in different profiling sessions.

For example, this can be useful to find out how particular changes in code affect your application’s memory usage. All you need are two snapshots taken before and after committing changes.

Cross-workspace snapshots comparison

dotCover

  • Filtering processes from console runner lets you reduce unnecessary overhead by excluding child processes that are irrelevant to the coverage analysis. To enable a process filter, use the /ProcessFilters parameter. For example, /ProcessFilters=+:prA;+prB will exclude all processes except prA and prB; /ProcessFilters=-:prC will exclude prC from the coverage.
  • Hide auto-properties option allows you to exclude auto-properties from the coverage analysis.

Please feel free to download the latest 2016.2 EAP build and let us know what you think. If you have any problems, please raise issues in ReSharper, ReSharper C++, dotTrace, dotMemory or dotCover issue trackers.

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

Rider – the story so far

Last time, we had a look at what was new in the June EAP of Rider, our .NET IDE.

This time, we’re going to go back to the beginning and have a look at some of the interesting features we’ve added during the EAP so far.

This includes:

  • Core IDE features
  • NuGet
  • File Structure
  • Solution Wide Analysis

Core IDE features

Rider is a .NET IDE, and as such, requires a certain set of functionality, such as opening and creating projects, build and debug, and of course, an excellent editing and code navigation experience.

Rider supports opening Visual Studio solutions and .csproj based projects. It also supports .NET Core applications, as long they also have a solution and .xproj files (remember, .NET Core tooling is changing back to MSBuild based .csproj files. Rider will support this, too).

And of course, it allows creating projects, too, with project templates that can create executables, class libraries and .NET Core projects.

Project templates

But Rider would be nothing if it didn’t have a good editing experience. And here, Rider takes full advantage of both its ReSharper and IntelliJ heritage, to provide all the functionality that you know and expect from a JetBrains IDE: complete statement, auto-completing brackets, tooltips and parameter info, live templates, and of course lightning fast code completion, either when you type ., or automatically, in context, like completing a type name after new.

Code completion

Rider also includes very rich navigation, making use of IntelliJ’s Search Everywhere feature to search for classes, symbols, or files, even searching for IDE actions and settings. In addition, you can Ctrl+click to go to definitions, go to file member, and of course use the Navigate To context menu to move up and down a class hierarchy or use other navigation options:

Navigate To context menu

And who can live without Find Usages?

Find Usages tool window

Rider has been designed to make the most of the investment we’ve put into ReSharper for the past 10+ years. Rider uses ReSharper as an out of process language server, so any functionality we add to ReSharper can be used in Rider (and any functionality we add for Rider can also be used by ReSharper).

The protocol we’ve designed for the Rider frontend to talk to the ReSharper language server is very lightweight, two way and asynchronous. On top of that, the data we’re sending between the two processes is designed to also be very lightweight – little more than “view models”.

For example, every advanced IDE needs to display inspection highlights – “squigglies”. With Rider, these inspections are carried out by ReSharper, out of process, and the data is passed to Rider, as a “view model” – essentially a list of offsets, highlight types and tooltip text.

This means that Rider immediately gets access to all of ReSharper’s over 2000 inspections.

Inspections with tooltips

And what would a JetBrains IDE be without Alt+Enter?

Everybody’s favourite keyboard shortcut is there, ready to safely rewrite code to apply quick-fixes to all of those inspections, or perform context specific actions like converting a string literal to string interpolation, or even marking it as a regular expression!

Alt Enter context menu

While the protocol allows us to reuse a lot of existing functionality, some features, such as refactoring, take a bit more work. Interestingly, a lot of the work is to create new UI for the workflows – ReSharper already knows how to rewrite your code, but it needs to know what you want to do. Which means we don’t have all of ReSharper’s refactoring support available in Rider right now. But we do support a number of refactorings, especially the most important – rename.

Rename dialog

NuGet Support

NuGet has changed the way we consume dependencies in a .NET project – referencing packages is a lot better than manually downloading libraries, adding them to a libs folder and checking them into source control.

So of course, Rider has to support NuGet. And of course we wanted to sprinkle a little JetBrains magic on it.

The idea behind our implementation is to be as fast as possible. When you search for a package, we return cached search results, so commonly used packages are available instantly. But we’re also updating the results in the background, so any new packages, or new versions, are added asynchronously.

The UI might be a little different to what you’re used to. The NuGet tool window is split three sections. The first is a view of the solution and project hierarchies, the second lists packages, and the third shows package details.

Selecting a node in the solution hierarchy lists the packages that are already installed, and provides a text box to search for packages to install. This list also shows when a package has an update available.

Clicking on one of these packages shows details in the final section of the window. This shows the package description, authors, license, project URL and so on. It also lists the available versions in a drop down – selecting one of these and clicking Apply will install, update or rollback to that version. Clicking the Remove button will of course remove the package.

And finally, the Restore button next to the solution hierarchy will restore all packages, downloading any that are missing.

NuGet tool window

Along the top of the tool window, you’ll notice some tabs:

  • Packages – the default view, for managing packages.
  • Sources lists all of the config files that NuGet is using to figure out what package sources are available. Rider will show what the effective list of sources are, and clicking on the config file will open it up in the editor.
  • Options allows configuring various aspects of Rider’s NuGet support, such as whether the search should include pre-release packages, and the default behaviour for resolving loosely specified dependencies.
  • Log shows the output of any NuGet operations, including errors and conflicts.

File Structure

The File Structure window shows an outline of the current file in the editor. So for a C# file, it will show classes, and under each class is a list of class members – methods, properties, fields, etc. Double clicking one of these will navigate the editor to the appropriate location in the source, and if you toggle the Autoscroll from source toolbar button, whenever you navigate around in the editor, the matching type member will be highlighted.

File Structure tool window

See the title of the tool window tab docked to the side of the window? 7: Structure – the “7” means that you can quickly get to the tool window by pressing Alt+7. This works for any tool window that has a number in front.

Solution Wide Analysis

Another feature that Rider has brought over from ReSharper is Solution Wide Analysis. When enabled, ReSharper will analyse all files in a solution, rather than just open files.

This gives ReSharper a much better view of your solution, which it can use to power a number of features. For example, it tracks cross-file symbol usage, so it can highlight public classes or methods that aren’t used in any file. It also maintains a list of errors in all files across the solution, and uses the cross-file usage information to intelligently and efficiently rescan only
affected files to keep the list up-to-date as you type.

The Errors in solution tool window in Rider will display the list of errors in your files, grouped by file. Double-clicking on an error will take you straight there, while using the Next error action in the editor will cycle through all errors in the list, across all files.

Errors in solution tool window

And just like in ReSharper, there is a little icon in the bottom right of the status bar, showing if the solution has errors or not, allowing you to use the feature without having to have the tool window open. Clicking the number of errors cycles through them, while clicking the icon will open a small context menu to get quick access to useful features.

Errors in solution status bar icon

Solution Wide Analysis is disabled by default. Scanning all of the files in a solution obviously has an impact on resource usage, and we would rather you opt in to this behaviour. For most real world solutions, the disk-based caches happily handle the extra data required, and once the initial scan of all files is done, the cross-file usage data makes keeping the list of errors up-to-date very efficient.

And since Rider uses ReSharper as an out of process backend language server, ReSharper has much more headroom to allocate and use memory that won’t affect other aspects of the IDE. So give Solution Wide Analysis a go on your solution!

Rider is still in private EAP, although we are getting ready for a public preview. If you’d like to give it a go right now, please head over to the signup page, and we’ll send you a download link.

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

ReSharper Ultimate 2016.2 EAP: Builds 7 and 8

ReSharper Ultimate 2016.2 EAP goes on, and we’ve recently published two more builds. Here is what has been fixed, and below are some new features in these builds.

Improvements in surround templates

We have been working towards merging live and surround templates as well as improving the availability of templates.

As of now, each non-file template can be used for generating code, for surrounding code, or for both, which lets you reuse your custom surround templates as live templates and vice versa, reducing their total count.

Another new thing here is that surround templates become available in the completion list, so you can start typing the name of a surround template as soon as a selection is made without pressing any additional shortcuts:

Surround templates in completion lists

The traditional way of invoking surround templates with Ctrl+E,U (ReSharper | Edit | Surround With Template) is also improved. The problem of too many templates in the Surround With pop-up, previously addressed with the editable ‘quick access list’, is now solved another way: while the pop-up shows all available templates, you can start typing a template name to shrink the list.

Marking language injections with comments

When a string literal contains a formal language, ReSharper can provide its code analysis and assistance features right inside this literal. Since v. 9.0, this has been available for regular expressions, and v. 2016.2 brings support for injected HTML.

Let’s recap how it works. As it’s impossible to automatically detect whether the formal language is intended in the literal, you have to mark the injection explicitly in one of the following ways:

  • Use the context action, which actually tells ReSharper to mark the symbol range corresponding to the string as Regexp/HTML, save this range in its internal database and keep track of it as the containing file changes. This way is very quick and straightforward, but there are two downsides: the range can be lost after an external file change, such as a VCS merge, and the injection marked this way will only be tracked locally.
  • Mark method parameters accepting regular expressions with RegexPatternAttribute from JetBrains.Annotations. This is the recommended way for regular expressions in parameters.
  • ReSharper 2016.2 introduces a third way: you can put a comment /*language=html|regexp|jsregexp*/ before the string literal. Granted, these comments require some typing and you can even think of them as contaminating your code. However, they make your intention clear to everyone who reads your code, they won’t get lost, and anyone opening your code with ReSharper will get the same features in the marked strings. By the way, the format of comments is compatible with IntelliJ Platform-based IDEs.
    Language injection with comments

More C# typing assistance

In addition to the smart behavior of dot and semicolon inside braces, which
we mentioned previously, ReSharper now automatically corrects mistyped @$ prefixes for verbatim string interpolations:

Generating abstract members in TypeScript

In TypeScript, you can now generate implementations for abstract members using either the Generate menu (Alt+Insert) or a quick-fix:

Generating abstract members in TypeScript

Please download the latest 2016.2 EAP build and give the new functionality a try. As usual, we would love to get your feedback via ReSharper issue tracker.

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

Rider EAP update: unit testing, .NET Core, and more

We recently (June 20) published a new private build of Project Rider, our standalone, cross platform C# IDE. We’re getting closer to starting the public preview, and so we’ve decided to start sharing details of the new features that are making it into the latest private EAP builds.

Obviously, previous EAP builds have had their fair share of new features, such as the File Structure view, Solution Wide Analysis, and the NuGet Explorer, as well as more fundamental architectural work, such as enabling inspections, the Alt+Enter menu, various refactorings and of course build and debug. We’ll take a look at some of these existing features in posts closer to the public EAP release, but for now, we’re going to start talking a bit more about what’s in the latest builds.

So, what’s new with the latest EAP?

As well as fixing a number of bugs (including some with the NuGet support), we’ve added some new things that we think you’ll like. Here are the highlights:

  • Unit test runner
  • ASP.NET Core support
  • To-do Explorer
  • Stack Trace Explorer

Unit Test Runner

The big news for this release is the addition of the unit test runner. This has been a very heavily requested feature, and we’ve worked hard to bring an initial version to Rider.

You should find the functionality very familiar if you’re already used to ReSharper. Rider has support for NUnit and xUnit by default. It does not currently support MSTest, as MSTest is too closely tied to Visual Studio.

Rider will discover tests in the editor, as you type, just like in ReSharper, and add a gutter icon to indicate test classes and test methods. You can either click this icon or use the Alt+Enter menu to run tests, which will be displayed in a test runner window very similar to the one in ReSharper.

Run tests from the alt enter menu

The tool window has multiple tabs, one for each session. The tab will show a tree view of the tests that are going to be run, with status icons to show pass, failed, skipped, etc. The output pane shows any output or failure messages, with the stack trace parsed and click-able for easy navigation. Double clicking the test in the tree will also navigate to the test method in the editor, and there is a toolbar to control running, stopping, deleting, grouping and so on.

Running tests

This is initial support, and there are still a number of features that we haven’t yet implemented, such as debugging, or more ubiquitous means of running tests. But don’t worry, we’re not done yet. We wanted to get this feature into your hands as soon as we could, so you can try it out, and let us have your feedback!

ASP.NET Core support

Rider uses ReSharper as an out of process language server, and is built from the same codebase that is the current 2016.2 EAP. This means it benefits from ReSharper’s support for ASP.NET Core projects, and can create new and open existing .NET Core projects. Furthermore, Rider includes project templates that allow you to create a new .NET Core executable or class library, so you can build your own projects from scratch.

Like Visual Studio, Rider requires existing projects to have both  .sln and  .xproj files; it doesn’t support opening a  project.json file directly. And of course, with the recent announcements that  project.json is being replaced by MSBuild  .csproj files, it is now very unlikely that we will implement this support only for it be obsolete in a few months time. If you have an existing project that only has  project.json, you can create a new project in a temporary folder and copy the  .sln and  .xproj files across and Rider will be able to open the project.

Once a project is open, Rider fully recognises the new style of referencing packages rather than assemblies, and the References node in the Solution Explorer will show packages and dependencies. Other functionality – smart editing, code completion, navigation and so on – just works.

We even get to take advantage of ReSharper’s advanced functionality, such as code completion and navigation for controller actions, and that includes from ASP.NET Core’s new tag helpers in  .cshtml files (oh yes, we support  .cshtml files too, with syntax highlighting, code completion, navigation, and even code completion and find usages on CSS classes).

Tag helper in code completion

To-do Explorer and Stack Trace Explorer

Another couple of new tool windows that we have added in this release are the To-do
Explorer and the Stack Trace Explorer.

The To-do Explorer works very much like you’d expect from ReSharper – scanning comments in your code that match // TODO: Fix this and pulling those out into IntelliJ’s own To-do Explorer tool window. Each item is shown as a node in the tree, grouped by file, and double clicking the item will take you to the line in the editor.

The To Do Explorer

Even better, we get to take advantage of existing IntelliJ functionality. From the Commit Changes dialog, if the Check TODO checkbox is selected, Rider will look for to-do items in the changes being committed, and allow you to review them – but only if it’s a new to-do item! The comment has to be in a block of text that has been changed.

Commit dialog checking for TODO items

The Stack Trace Explorer is simple, under the Tools menu, select Analyse Stack Trace. A new dialog opens that shows a simple text control, which shows the contents of the clipboard by default. Clicking OK on this dialog opens the Stack Trace Explorer, which parses the stack trace and makes each element clickable, so you can use it to navigate to any method or type in the stack trace.

Stack trace explorer

Summary

One thing to point out is that it’s not just updates to ReSharper that make it into Rider, but updates to the IntelliJ Platform, too. This build of Rider is based on a newer version of the IntelliJ Platform that gives new features over previous builds, such as improved log views for Git and Mercurial in the source control integration, and even font ligature support in the editor!

However, while it is nice to pull in the latest platform updates, this version of the IntelliJ Platform is still in EAP, which means some of the plugins in the default plugin repository are not yet marked as being compatible. For example, IdeaVim, which adds Vim emulation to the editor, requires an install of an EAP build, from an additional EAP plugin repository, as detailed in the readme.

As ever, please remember that this is still a private EAP build – we’re actively building the product and implementing features, and still require as much feedback as possible. Please try it out (if you haven’t already signed up, you can easily do so on the website), and let us know about any issues you encounter.

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

ReSharper Ultimate 2016.2 EAP: Builds 5 and 6

Another couple of ReSharper 2016.2 EAP builds has appeared since our last post. If you haven’t done it yet, it’s the right time to download and try out new features and fixes. In these builds, we have fixed a numbers of issues as we normally do, improved support for the recently released .NET Core 1.0 and ASP.NET Core 1.0, and below are descriptions of some new features.

HTML analysis inside .cs, .js, and .ts files

If you wanted to cut corners and define some constant piece of HTML right in a string literal, you could miss some errors there… but not any longer. In C#, JavaScript or TypeScript, you can now use the Make HTML here action to enjoy syntax highlighting, error detection and other HTML goodies right inside the string literal:

Injecting HTML inside a string literal

New decompiler features in ReSharper and dotPeek

  • The code that the IL Viewer displays becomes more readable: types, members, type parameters, local variables, etc. are highlighted with distinct colors; loops in your code can be distinguished by corresponding indents and comments:

    IL viewer with highlighting and formatted loops

  • The arsenal of visual dependency analysis tools (Type Dependency Diagram and Project Dependency Diagram) is now extended with the new Assembly Dependency Diagram. You can invoke it on selected assemblies in the Assembly Explorer and study how those and referenced assemblies are linked with each other:

    Hierarchy of assembly references

ReSharper C++

  • The latest 2016.2 EAP build includes an important optimization of C++ code analysis. For example, this optimization makes indexing (first opening) of the Unreal engine project several times faster.
  • Auto-completion in C++ now also suggests symbols that are not included in the current file. Of course, the corresponding #include directives are added automatically:

    Import suggestions in C++ auto-completion

  • There is a new code inspection that warns you about missing include guards in your header files. As a quick-fix, it lets you automatically add #pragma once directive.
  • And there are also a couple of new code formatting options: a line break in a member initializer list, and a space between closing angle brackets in template arguments (for conformance with pre-C++11 compilers).

You are welcome to download the latest 2016.2 EAP build. Should you come across any problems, please let us know in ReSharper, ReSharper C++ or dotPeek issue trackers.

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

ReSharper Ultimate 2016.2 EAP: Builds 3 and 4

In recent weeks, we’ve published builds 3 and 4 of the ReSharper 2016.2 EAP, and we have a lot to share with you, including a couple of new features, as well as the usual round of issues being fixed.

So, what’s new?

ReSharper

First up is continued improvement to our support for .NET Core RC2 projects, with a number of issues fixed.

Secondly is a new feature we’re formally calling Structural Navigation, but is also known as “tab navigation”. The idea of this feature is to allow you to use the Tab and Shift+Tab keys to quickly move the text selection to the next or previous code element without having to use the cursor keys, allowing you to quickly navigate to the next important piece of code you need to edit.

For example, when editing a method call, repeatedly hitting Tab will select each argument in turn.

Structural Navigation navigating method arguments

Or when editing a  for statement, Tab will select the initialiser statement, then the terminating condition and then the iterator statement. Shift+Tab will do the same, but in reverse.

Structural Navigation navigating for loop elements

Of course, Tab will continue to handle template expansion, and will also indent (and Shift+Tab will outdent) when the text caret is placed at the start of a line. But when the text caret is placed with a code element, Tab and Shift+Tab will start navigating and selecting the structure of your code. You can change this behaviour in the options.

We really welcome your feedback on this feature – we’re finding it useful for quickly copying and altering code, or working with elements in string interpolation. This currently works with C#, HTML, XML and XAML as well as Razor files, and we’ll be adding support for other languages as the EAP continues.

SSR patterns can now be suppressed with a standard comment. A Structural Search and Replace pattern can be used to create your own ReSharper inspections, declaratively (see the web help for more details).

These highlights are treated just like ReSharper’s own inspections, with one big exception – until now, it’s not been possible to suppress an inspection with the standard // ReSharper disable once ... style comment.

EAP3 includes a new field in the SSR dialog, called “Suppression key” where you can specify the text that will be used and recognised in the comment.

Suppress SSR pattern with comment

C# support gets a number of new features:

  • Check all parameters of a method for  null (or empty strings) from a single Alt+Enter menu.
    Context action to add guard clauses for all arguments at once
  • You can now uncomment or even delete a comment straight from Alt+Enter.
    Uncomment or delete a comment from the Alt + Enter menu
  • We’ve added new quick-fixes for string literals containing invalid escape characters, to either replace with a verbatim string, or escape the characters.
    Quick-fixes for invalid characters in string literals
  • And interpolated strings get support for localisation, with a highlight to suggest converting the interpolated string to a resource, as well as both a quick-fix and a refactoring to automate the process.

Visual Basic gets some love:

  • String interpolation suggestions, quick-fixes and context actions for VB.NET to convert  String.Format method calls to string interpolation, as well as context actions to convert a string literal to an interpolated string, or insert an interpolated argument.
    Convert VB string concatenation to string interpolation
    Note that this requires  Option Strict to be enabled to ensure correctness of the converted expression.

And the JavaScript, TypeScript and JSON support gets updated:

  • TypeScript support gets a couple of fixes in this build, with the most notable being how we resolve definition files referenced by JSPM (RSRP-458759), by parsing details directly from calls to  System.config().
  • JavaScript rename refactorings will now update JSDoc items.
  • JSON value helpers allow you to tell ReSharper to provide code completion or validation for your own JSON files, either complementing an existing schema, or if the file doesn’t have a schema.
    You can add a helper in the JSON Value Helpers options page, matching based on a filename mask and/or schema match, and providing a path to the JSON property (such as /compilerOptions/rootDir), and the type of helper to apply – regular expression, file path or even license.
    Value helper options
    And then, in the JSON file itself, the value will now get code completion:
    Value helper showing code completion for a file path
    These value helpers are saved by default to the global settings, but using the Save To button in the options dialog, can be saved to a  .sln.dotSettings file that can be checked in and shared with the whole team.
  • Custom JSON schema catalogs can be added in the JSON options. These can be either a file, or a URL, which will be downloaded in the background, and periodically updated. More details can be found in the “Public API” section on schemastore.org.
  • Another very useful fix in this version is the return of autocomplete of package version in bower.json files, for all versions of Visual Studio.Code completion for bower packages and versions

ReSharper C++

ReSharper C++ also gets a set of new features:

  • Support for C++14 language features: variable templates and  decltype(auto).
  • Warning about usages of classes and functions marked with the [[deprecated]] / __declspec(deprecated) attribute:
    ReSharper showing highlight for deprecated C++ code
  • Support for the [[noreturn]]/ __declspec(noreturn) attribute in control flow inspections.
  • A code inspection and a quick-fix to replace zero constant with false in boolean context:
    C++ code converting constant expression to boolean
  • New code style options that control the format of generated include directives.
  • Inline Variable refactoring:
    C++ inline variable
  • A new formatter option to allow single line function and lambdas.
  • The mock function generator now supports the Trompeloeil framework.
  • Support for completion, find usages and rename of symbols in doxygen comments.

As ever, please download a fresh build from the EAP page, and if you encounter any issues, please raise an issue in ReSharper or ReSharper C++ issue tracker.

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