Resharper visual studio 2017


Meet ReSharper Ultimate 2017.1! - .NET Tools Blog.NET Tools Blog

This year’s first major release of ReSharper Ultimate is finally here with an ultimate support for Visual Studio 2017! We invite you to download the 2017.1 update and check all the long-awaited features, which you can read about in this post.Along with 600+ fixes in ReSharper and 110+ fixes in ReSharper C++ this release comes with the following major improvements:

Let’s dig into the details!

Visual Studio 2017 RTM support

ReSharper 2017.1 can now work with solutions loaded in a lightweight mode. When you use the Open Folder option, ReSharper sees all the files in the folder and supports .xml and .js file types. Move to Folder refactoring works in this mode.

ReSharper also respects the current target framework context, which is set by the drop-down at the top of the editor window. You’ll find more details about ReSharper’s support for the latest Visual Studio version in the video below:

C# 7 support

ReSharper receives a lot of new inspections, introduces new quick-fixes, and updates existing ones to support C# 7 language features.

We’ve extended ReSharper’s support for local functions and added two context actions that allow you to convert lambda expression or anonymous method into a local function and convert local function into a regular method. There’s also a new quick-fix that suggests converting a read-only delegate variable into a local function.

Join null check with assignment quick-fix has been implemented to support throw expressions. It makes the code more readable by combining the assignment, the null-coalescing operator, and throw. The existing context action Convert to ‘?:’ operator and the .throw postfix template also support C# 7 throw expressions.

Watch the video to see how ReSharper helps you use the new C# 7 features:

Unit testing

ReSharper’s unit testing works in both project.json- and .csproj-based projects in Visual Studio 2017 RTM. It discovers and runs MSTest and xUnit tests and supports code coverage and profiling as well as targeting multiple frameworks. NUnit tests that target .NET 4.x frameworks are supported. There’s also DataRow support for MSTest v2.

Note that ReSharper currently doesn’t support continuous testing for .NET Core unit tests. This will be fixed in the next updates.

EditorConfig support and other code style improvements

Maintaining a consistent code style throughout your code bases is important since making the code more readable for all project contributors saves everyone’s time and even helps you avoid some errors. ReSharper 2017.1 provides several new features for keeping your code neat and clean. Watch the video for a quick overview of some of the updates and read on for more details.

EditorConfig support

EditorConfig offers a convenient way to share code style settings with colleagues who use different editors and IDEs. EditorConfig support in ReSharper 2017.1 is enabled by default. Below is an example of .editorconfig file settings supported by ReSharper:

root = true [*] # Most of the standard EditorConfig properties are supported indent_size=2 max_line_length=100 # Most of Roslyn EditorConfig properties for Visual Studio 2017 are supported csharp_space_between_parentheses=expressions, type_casts, control_flow_statements csharp_new_line_within_query_expression_clauses=true # Custom EditorConfig properties for every code formatting setting available in ReSharper options resharper_csharp_brace_style=next_line resharper_csharp_blank_lines_around_invocable=2

root = true

[*]

# Most of the standard EditorConfig properties are supported

indent_size=2

max_line_length=100

 

# Most of Roslyn EditorConfig properties for Visual Studio 2017 are supported

csharp_space_between_parentheses=expressions, type_casts, control_flow_statements

csharp_new_line_within_query_expression_clauses=true

 

# Custom EditorConfig properties for every code formatting setting available in ReSharper options

resharper_csharp_brace_style=next_line

resharper_csharp_blank_lines_around_invocable=2

For more details on what EditorConfig properties ReSharper understands, refer to the Using EditorConfig help section. And watch the video to see how ReSharper uses EditorConfig to share formatting settings across your team:

Layered settings for tabs and indents

ReSharper’s layered settings feature is a great tool to maintain a consistent code style if most of your team members use ReSharper. Now it is extended with Tabs and Indents settings for all supported languages.

Autodetection of the indent size and style

When you contribute to existing projects you may not have enough time to fine-tune code style settings. This is where a new ReSharper’s feature comes in handy. ReSharper now automatically detects and sets the indent size which is used in a file. This feature is disabled by default and can be enabled on the General Formatter Style ReSharper’s options page.

File formatting info

The new File Formatting Info window displays the sources of code style settings, including scopes and properties defined in all active .editorconfig files, the source of indentation settings and its value, and the status of indent autodetection.

Contextual configuration of formatting rules

The process of adjusting a new tool for your preferred code style can be tedious. To save your time, ReSharper offers contextual configuration of the formatting rules, which is now available in С#, C++, JavaScript and TypeScript. Select some code, press Alt+Enter and choose Format Selection | Configure to see formatting rules that affect only the selected code.

Code style, formatting and cleanup improvements

ReSharper’s Code Cleanup gets usability improvements. Now you can create and configure your custom task-specific profiles right in the Code Cleanup dialog box, simply by pressing Ctrl+E,C.

ReSharper applies its configured formatting rules to any code you paste. The Reindent option that affects only the indentation is set by default and you can change it on the Editor Behavior options page.

ReSharper 2017.1 introduces new code style settings for C# type members bodies, allowing you to choose between always using a body block, with braces, or using the expression format. ReSharper will mark any incorrect usage and provide a quick-fix to quickly rewrite to the correct style.

C# code formatting engine has been significantly rewritten. We’ve fixed a lot of bugs and introduced new formatting options:

  • The new wrapping engine now handles the alignment correctly
  • Comma-first wrapping style is supported
  • Set spaces before and inside the parentheses of ‘nameof’
  • Choose preferred wrapping style for chained binary expressions
  • Configurable line breaks in a single ‘case’ statement

Navigation and search

Finding usages of a specific interface or type becomes even more convenient with a new button in Find Results window to group by kind of usage. The filter was updated so that you can select specific usage occurrences. ReSharper also highlights broken or unfinished usages, which helps to determine what’s left to fix. Watch the video below to learn more about the updates to the Find Results window.

The Go to Everything and Go to Text popups support inline commands for advanced filtering of search results:

ReSharper’s Search & Navigation page adds a new option to open files in the preview tab from everywhere. This option is turned off by default.

Angular 2 templates syntax

ReSharper understands the following elements of Angular 2 templates syntax: template expressions, template statements, NgFor directive and template variables. Support is implemented for the template: property in Angular @Component decorator as well as for pure HTML referenced by templateUrl: property in @Component. Only relative paths are supported in templateUrl. For HTML pages, Angular markup is switched off by default and can be enabled in ReSharper Options (Code Editing | HTML | Editor).

The Rename refactoring works for component tags and for ‘foo’ in [class.foo].

Component attributes receive support for the Go to Declaration (F12) command.

Code completion works for Angular attributes and component tags, as well as for [attr., [style. and [class..

Note that Angular 1 is not yet supported. You can use the AngularJS plugin for code completion and live templates, if Support Angular markup in HTML pages is set to ‘None’ in ReSharper options.

TypeScript and JavaScript support

We implemented full support for TypeScript 2.1 and initial support for TypeScript 2.2.

In TypeScript 2.1 ReSharper now understands mapped and indexed types, object rest and spread properties, updated logic for literal types, configuration inheritance, untyped imports, combined types normalization, partially annotated signatures, and control flow analysis for implicit any and implicit any arrays.

In TypeScript 2.2 ReSharper supports ‘object’ type, JSX spread syntax and deriving (extends/implements) from signatures/tuples/intersections/mapped types.

The Rename refactoring in TypeScript works faster for local symbols and gets a new option to disable search for dynamic usage of TypeScript symbols in JavaScript files via a checkbox in the Rename dialog.

The Generate Code menu gets a new option to generate properties or read-only properties for TypeScript classes. The Generate Overriding Members command now calls ‘super’ whenever possible.

TypeScript gets highlights and quick-fixes for unused imports in ES6 style imports.

You can now speed up your coding in JavaScript and TypeScript by taking advantage of postfix templates:

ReSharper also improves relevance of code completion items in TypeScript and JavaScript; supports Navigate to Implementing Members in TypeScript and Navigate to Function Exits in TypeScript and JavaScript.

Code Analysis

ReSharper’s File Status Indicator (the small icon at the top of the Error Stripe) receives a new context menu. With a right-click on the icon, you can quickly toggle not only ReSharper code analysis but also identifier highlightings and Visual Studio code analysis (lightbulb and squiggles). If there are code issues in the current file, you’ll also see commands for navigating between issues of the highest severity level.

Note that for large files ReSharper suspends code analysis automatically. In this case, you’ll see a gray Pause icon in the Status Indicator.

ReSharper C++

ReSharper C++ 2017.1 introduces initial support for the Open Folder functionality and CMake-based projects in Visual Studio 2017. If you want to use ReSharper’s unit testing capabilities, you’ll need to configure a test run on the new C++ Tests page in ReSharper options. Please note that support for this kind of projects is still experimental — do let us know if you experience any problems!

Speaking about performance, ReSharper C++ significantly improves its memory usage, including both memory footprint after indexing and memory traffic during indexing. Moreover, the reindexing process should trigger less often during the normal workflow, as ReSharper C++ will not, by default, invalidate includers after preprocessing directives change in an included file.

We’ve enhanced inspections and code cleanup:

  • The Update file header cleanup task and a set of cleanup tasks to fix common code issues are added
  • Control flow inspections are updated to handle class fields in addition to local variables and function parameters
  • The inspection Declaration and assignment can be joined is implemented, together with an accompanying quick-fix
  • Introduced several custom C++ 11 attributes that can be used to mark printf-style functions (RSCPP-15890), functions with side effects (RSCPP-18615), and guard classes for which the Unused variable highlighting should be suppressed (RSCPP-18764)

The set of postfix templates is extended with beg..end, new, var, const_cast, dynamic_cast, reinterpret_cast, static_cast, make_shared, and make_unique. You can configure the availability of C++ postfix templates and other settings on the Postfix Templates page in ReSharper options.

ReSharper C++ also improves code formatting:

  • Indent size and style can be auto-detected
  • Indenting of preprocessor directives is now supported
  • Adds new formatter options: Indent namespace members, Space after parentheses in cast expressions and Break line in simple ‘case’ statement

Last but not least, ReSharper C++ supports inline commands for results filtering in Go to Everything and Go to Text popups, and grouping by kind of usage in the Find Results window.

For more details about new ReSharper C++ features please refer to the What’s New page.

You can now attach the dotTrace and dotMemory profiler to running applications using drag and drop. Simply drop a special icon onto the application window you want to profile.

We’ve introduced dotMemory Command Line Tool (dotMemory.exe) which is extremely helpful when you need to automate the process of gathering memory snapshots. The most basic tool usage scenarios are described in our Help.

Old-style highlighting in dotCover 2017.1 is back again and supports the updated logic to display both tests coverage and test results. There’s also an option to switch between markers and colored background or to display both.

Finally, we’ve implemented support for portable PDB in dotPeek. You can generate PPDB files, explore the contents of the Portable PDB associated with the assembly, and use sources embedded in the Portable PDB for navigation purpose.

That wraps it up. Please download a free 30-day trial of ReSharper Ultimate 2017.1 and check the new features and improvements.

Download ReSharper Ultimate 2017.1

blog.jetbrains.com

ReSharper Ultimate 2017.1 EAP: what's new in build 1

Last week we launched an Early Access Program for ReSharper Ultimate 2017.1. We hope that you’ve already downloaded the build and discovered some of the new features. Today we’d like to take a closer look at the most notable updates, which relate to the following product areas:

Visual Studio 2017

Long-awaited support for the Lightweight Solution Load mode is finally here. Some issues are still to be expected, but ReSharper should work correctly for most solutions.

ReSharper C++ works with the Faster Project Load option, which you can enable in Tools | Options | Text Editor | C/C++ | Experimental.

We’ve also been working to improve your folder-based experience that comes with the new Open Folder mode in Visual Studio 2017. ReSharper sees all files in the folder and supports .xml and .js file types. We are aiming to support C++ codebases in the next EAP update, and it would help us greatly if you could share your C++ Open Folder use scenarios in the comments below.

Local functions in C# 7

The new version of C# brought us local functions that can be defined in the body of any method, constructor or property’s getter and setter. Compared to lambda expressions, which you would normally use to define local helpers, local functions are more efficient when you want to write a function that is called only from the context of another method. They are your perfect choice for iterators, async methods and recursive algorithms. That said, we’ve extended ReSharper’s support for local functions and added two context actions that allow you to:

  • Convert lambda expression or anonymous method into a local function
  • Convert local function into a regular method

There’s also a new quick-fix that suggests converting a read-only delegate variable into a local function. Let’s see when it can be useful:

If needed, you can then convert the generated local function into a regular method:

EditorConfig support

We’ve introduced initial support for EditorConfig, which is enabled by default. This means that formatting styles defined in the .editorconfig files will override your current formatting preferences set in ReSharper and Visual Studio. If you want to ignore EditorConfig styles, clear the corresponding check-box on the Code Editing | General Formatter Style options page.

ReSharper understands standard EditorConfig properties, most of Roslyn EditorConfig properties, and provides a rich set of custom EditorConfig properties, which allow for much more granular configuration of formatting rules. This means that you can maintain the entire configuration of formatting rules in EditorConfig files. Below is an example of .editorconfig file settings supported by ReSharper:

root = true [*] # Most of the standard EditorConfig properties are supported indent_size=2 max_line_length=100 # Most of Roslyn EditorConfig properties for Visual Studio 2017 are supported csharp_space_between_parentheses=expressions, type_casts, control_flow_statements csharp_new_line_within_query_expression_clauses=true # Greater flexibility in configuring code formatting styles with custom EditorConfig properties resharper_csharp_brace_style=next_line resharper_csharp_blank_lines_around_invocable=2

root = true

[*]

# Most of the standard EditorConfig properties are supported

indent_size=2

max_line_length=100

 

# Most of Roslyn EditorConfig properties for Visual Studio 2017 are supported

csharp_space_between_parentheses=expressions, type_casts, control_flow_statements

csharp_new_line_within_query_expression_clauses=true

 

# Greater flexibility in configuring code formatting styles with custom EditorConfig properties

resharper_csharp_brace_style=next_line

resharper_csharp_blank_lines_around_invocable=2

When EditorConfig support is enabled, ReSharper helps you understand which EditorConfig styles are applied and where these settings come from. On ReSharper formatting options pages, you will see a yellow warning if at least one preference on a page is overridden by EditorConfig styles. Each overridden preference will be also highlighted with yellow:

The EditorConfig information window (which can be opened by clicking the EditorConfig indicator in the Visual Studio status bar) displays the scopes and properties defined in all active .editorconfig files.

Code formatting and navigation

The whole C# code formatting engine has been significantly rewritten: the new wrapping engine now handles the alignment correctly, and comma-first style is now supported and can be enabled on the Line Breaks and Wrapping options page. We’ve also fixed a lot of bugs.

Please note that all these changes to the formatting engine in EAP builds may cause new unexpected issues to appear. If you come across any unpleasant bugs, please report them to us and then go to the Other page in C# | Formatting Style options and select the Revert to old formatting engine check-box.

You can now quickly define formatting rules for any selected block of С# code with a context action. Press Alt+Enter over the selected block of code that you want to reformat and choose Format selection | Configure in the action list. The Configure Format dialog shows all formatting rules that affect the selected code block. As you change the formatting rules, you will see how they affect the code. Context configuration of formatting rules also works in C++, JavaScript, and TypeScript.

ReSharper can reformat any code you paste by applying its own formatting rules. The Reindent option is set by default and you can change it on the Editor Behavior options page.

Formatting Style for all languages receives a new options page Tabs and indents, which allows you to set your own indent size and style and save it for future use in the ReSharper settings layer. The indent size and style from Visual Studio is used by default.

ReSharper’s Search & Navigation page adds a new option to open files in the preview tab from everywhere. This option is turned off by default.

ReSharper code analysis

Your coding experience with ReSharper in large solutions can sometimes be sluggish. We’ve already discussed the two major sources of performance problems and provided a list of actions you can take to speed up ReSharper and Visual Studio. The simplest option is to add certain files to the ignore list. For large files ReSharper does this automatically, so that sometimes you might wonder why code analysis doesn’t work. To mitigate this confusion we’ve introduced a new context action menu for the Status Indicator (a small icon at the top of the Error Stripe). If ReSharper code analysis is suspended, you’ll see a gray Pause icon in the Status Indicator. With a right-click on this icon you can quickly toggle not only ReSharper code analysis, but also identifier highlightings and Visual Studio code analysis (lightbulb and squiggles).

Angular 2 templates syntax

ReSharper understands the following elements of Angular 2 templates syntax: template expressions, template statements, NgFor directive and template variables. Support is implemented for the template: property in Angular @Component decorator as well as for pure HTML referenced by templateUrl: property in @Component. For HTML pages Angular markup is disabled by default. You can enable it in the ReSharper Options (Code Editing | HTML | Editor). Currently there are a few limitations to templates syntax support that will be addressed in the next builds:

  • Code completion currently doesn’t work for angular attributes and component tags;
  • Rename refactoring works for NgFor and template variables, but in some cases it may fail for class properties that are referenced in Angular expressions;
  • Angular 1 is not supported yet, but this feature doesn’t conflict with our AngularJS plugin, if Support Angular markup in HTML pages is set to ‘None’ in ReSharper options.

TypeScript and JavaScript

We finally implemented full support for TypeScript 2.1, and initial support for version 2.2.

In TypeScript 2.1 ReSharper now understands mapped and indexed types, object rest and spread properties, updated logic for literal types, configuration inheritance, untyped imports, combined types normalization, partially annotated signatures, and control flow analysis for implicit any and implicit any arrays. In the example below, we are finding usages of ‘prop2’:

In TypeScript 2.2 ReSharper supports ‘object’ type, JSX spread syntax and deriving (extends/implements) from signatures/tuples/intersections/mapped types.

You can now speed up your coding in JavaScript and TypeScript by taking advantage of postfix templates:

We’ve also improved the relevance of code completion items in TypeScript and JavaScript.

The last but not least update to ReSharper’s support of TypeScript/JavaScript are the Navigate To Function Exits and Navigate To Implementing Members commands. These let you easily navigate to a function’s return statements and to all members implemented in the current class.

dotCover, dotTrace, and dotMemory

In dotCover 2016.3 we’ve implemented colored markers and completely changed the highlighting logic. Now it not only shows whether a statement is covered by tests, but also indicates test results. Since the new highlighting style may not be a good fit for all use cases, we’ve added an option to switch between markers and colored background or to display both. The old highlighting style also supports the updated logic and displays both tests coverage and test results.

dotCover now supports MSTest V2 unit testing framework that was introduced in Visual Studio 2017 RC, and the new portable PDB format.

We’ve addressed a few issues across all our .NET tools:

  • One of the performance issues was caused by the standard UTF8 converter. We’ve replaced it with a custom one and gained a noticeable increase in performance. (PROF-613, DCVR-8022).
  • Fixed a bug that affected exception filters instrumentation for the catch when instruction in C# 6 (PROF-617).
  • Startup project profiling now works for .NET Core applications. (PROF-598) Note that we cannot track which parameters were used when you created a publish profile in Visual Studio for your .NET Core project. We’ll always use the debug version of your application.

ReSharper C++

ReSharper C++ has significantly lowered its memory footprint. Our tests on a common solution showed an almost 30% decrease in managed memory usage when the solution was loaded from cache.

The set of postfix completion templates has been extended with beg..end, new, var, const_cast, dynamic_cast, reinterpret_cast, static_cast, make_shared, and make_unique. You can configure the availability of postfix templates and some other settings on a new Postfix templates page of the ReSharper options.

It’s a good coding practice to avoid declaring a variable until you have a value to initialize it. That’s why ReSharper C++ now identifies and highlights the code with a separate declaration and initialization of a variable. There’s also a new quick-fix to Join declaration and assignment.

Several custom attributes in C++ 11 are now available:

  • rscpp::format marks functions which accept printf-style format strings. Usage example: RSCPP-18764;
  • rscpp::has_side_effects marks functions with side effects. Usage example: RSCPP-18615;
  • rscpp::guard suppresses highlighting of the unused local variables. Usage example: RSCPP-15890.

And lastly, ReSharper C++ formatting engine adds the following new options:

That wraps it up. Stay tuned for the next valuable features and bug fixes coming soon!

Download ReSharper 2017.1 EAP

blog.jetbrains.com

Trying to live without ReSharper in Visual Studio 2017

This is an experiment that is doomed to failed, but given that I just setup a new VS 2017, I decided to see how it would feel to run it without ReSharper and how it impacts my workflow. Please note that this is very much not an unbiased review. I have been using ReSharper for my day to day coding for over a decade, and the workflow it enables is deeply rooted in how I work. I’m going to ignore any differences in key bindings, as irritating as that can be, in favor of just looking at different features.

So far, I spent a couple of days trying to work on VS 2017 without ReSharper. It has been quite frustrating, but I was able to sort of limp along. I most certainly felt the lack.

My hope was that I would be able to see the promised performance improvements without it, and then consider whatever it is worth it. That wasn’t the case.

As you can see, ReSharper is not installed, but I managed to get VS into a hang several times. It seems to happen with NuGet, or when trying to use the Test Explorer and a few times when I was trying to edit code while the solution was compiling.

Without any meaningful order, here are the things that I really felt the lack of.

  • Go to definition with automatic decompile is something that I apparently use a lot more than I expected. It helps figuring out what I can expect from the method that I’m looking at, even when it is not our code that I’m looking at.
  • Refactor method ignoring whitespace lets me just write a statement and it becomes a method name. This is actually quite nice.
  • Quick docs in R# is very nice, that is, the ability to hit Ctrl+Q and get the docs for a method is something that I seem to be using a lot. This is important because I can quickly check the docs (most often, what conditions it has for returning, or specific arguments. The key here is that I don’t need to leave my current context. I can Ctrl+Q, peek at the docs, and then move on.

  • Extract variable isn’t there, and so are a lot of the refactoring that I’m used to aren’t there or are hardly accessible.
  • IntelliSense is also a lot less intelligent. Being able to write a method and just Ctrl+Space all the parameters because R# can fill the context is very useful.
  • Ctrl+N, (symbol search) is also a LOT more useful. I’m familiar with the Ctrl+; to search solution explorer, but the features don’t compare. In one case, I get live feedback, which means that I don’t have to remember nearly as much about the symbol that I’m looking for. On the other hand, I have to write it and hit enter to see the results. There is also an issue with the presentation. Solution explorer is really poor model for it.
    There is a lot of wasted space in the VS model versus the R# model.
  • Update: I have since learned about VS' Ctrl+, feature, and that seems much nicer, and it also does auto peeking, which I like.

In general, to be honest, R# feels smarter (remember, I’m biased and likely work to the strengths of R#). But another aspect here is that with R#, I rarely have to leave my current context, pretty much everything is available immediately from where I am.

Even something as simple as the search above. With R#, this shows up in the middle of the screen, with VS, that is all the way at the right, so I need to move my eyes to track it. The same is pretty much true for everything else. Reference search in R# shows where I’m looking at right now, and with VS, it shows in a window in the bottom. Refactoring options in VS show up in the top right, and it is easy to miss them completely, R# put them in the front, along with what you are working on right now.

I’m going to install R# for VS 2017 shortly, and then I’ll be able to compare the speed, but I’m pretty sure that I’m not going to be very happy with that. Then again, once it is loaded, I haven’t noticed R# + 2015 being much worse than 2017 without Resharper.

Not that I’m doing this during my usual work, on a solution with 55 projects and 820 KLOC.

Update

I have tried R# & VS 2017 for a couple of days now, and I can tell that aside from the project open times (which are absolutely atrocious with R#), I’m not seeing anything major performance wise.

That said, project open time are also “switch between branches”, and that is a major PITA.

Of course, I’m guessing R# is really popular, because:

I can guess someone was tired of “visual studio is slow” when it is someone else’s code, and they wrote this to point the blame on the relevant extension so the bug report would go to the appropriate people.

ayende.com

ReSharper Ultimate 2017.1 EAP: what's new in builds 2 and 3

We’ve just released the third Early Access Preview build of ReSharper Ultimate 2017.1. Let’s take a look at the recent changes in this and EAP 2.

TypeScript and JavaScript

This build introduces a number of performance fixes for TypeScript and JavaScript, as our processing of file dependencies has been rewritten and optimised, wildcards in tsconfig are handled better, and the Rename refactoring for local symbols is also faster, with the ability to disable search for dynamic usage of TypeScript symbols in JavaScript files via a checkbox in the Rename dialog.

The Generate Code menu gets a new option to generate properties or read-only properties for your TypeScript classes, and we’ve updated the Generate Overriding Members to now call ‘super’ whenever possible.

TypeScript also gets highlights and quick-fixes for unused imports in ES6 style imports. And finally, we’ve fixed an issue where we weren’t properly handling the typeRoots property from tsconfig.json.

C#

ReSharper has two ways of specifying how you want your code to look – Formatting Style and Code Style. Formatting is all about the syntax of your code, indenting, wrapping, the layout of braces, etc. Code Style is all about changing your code without changing the semantics, for example, explicitly using a type name, or using var.

This build introduces new Code Style settings for type members bodies, allowing you to choose between always using a body block, with braces, or using the expression format. ReSharper will mark any incorrect usage and provide a quick-fix to quickly rewrite to the correct style.

And of course, we’re still working on C# 7 support, with this build correctly supporting ValueTask<T> and user defined, task-like types.

Visual Studio 2017

We’re continuing to improve our support of Visual Studio 2017 in these two builds, with the Move to Folder refactoring now working in Open Folder mode. We’ve also fixed an issue so that ReSharper will properly respect the current target framework context again. This is set by the dropdown in the top of the editor window, and can change settings such as the assemblies being referenced, as well as symbols defined in the build and pre-processor.

C++

ReSharper C++ sees a couple of important updates. Firstly, we have made a change to reduce the time spent reindexing after a new preprocessor directive is added to a header file. This change means that we no longer reindex any file that includes the changed header file. We’re looking for feedback on this change, so please let us know if you see any red code or broken navigations or refactorings with this build. The old behaviour can be restored using an option in the Code Editing | C++ | Performance options page.

Secondly, this build adds control flow inspections for class fields to the existing inspections for local variables and function parameters.

And finally, we’ve added a nice new option to automatically detect and set the indent size your code is using. The option is disabled by default, but when enabled, ReSharper will keep the Visual Studio indent size setting up to date with the discovered indent size of the currently open file.

Please, download the latest EAP build from our shiny new Early Access page, andgive it a go. As ever, let us know any issues you run into!

blog.jetbrains.com

ReSharper crashing Visual Studio 2017 – ReSharper Support

ReSharper is crashing VS 2017. I can get it to do 100% of the time. I startup VS and load my solution. As soon as I try to do anything it crashes. I can work around it by suspending ReSharper, loading the solution, and the resuming ReSharper. After that, it works fine.

I've uploaded a the debug file: Output_3f60_2017-08-03_12-52-43-894.txt

Microsoft Visual Studio Enterprise 2017 Version 15.2 (26430.16) ReleaseVisualStudio.15.Release/15.2.0+26430.16Microsoft .NET FrameworkVersion 4.7.02542

Installed Version: Enterprise

Architecture Diagrams and Analysis Tools   00369-90005-63722-AA043Microsoft Architecture Diagrams and Analysis Tools

Visual Basic 2017   00369-90005-63722-AA043Microsoft Visual Basic 2017

Visual C# 2017   00369-90005-63722-AA043Microsoft Visual C# 2017

Visual F# 4.1   00369-90005-63722-AA043Microsoft Visual F# 4.1

Add New File   3.5The fastest and easiest way to add new files to any project - including files that start with a dot

ASP.NET and Web Tools 2017   15.0.30503.0ASP.NET and Web Tools 2017

ASP.NET Core Razor Language Services   1.0Provides languages services for ASP.NET Core Razor.

ASP.NET Web Frameworks and Tools 2017   5.2.50303.0For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   15.0.30209.0Azure App Service Tools v3.0.0

Azure Data Lake Node   1.0This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.2.5000.0Microsoft Azure Data Lake Tools for Visual Studio

Bundler & Minifier   2.4.340Adds support for bundling and minifying JavaScript, CSS and HTML files in any project.

Common Azure Tools   1.9Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

CSS Tools   1.0.14Provides additional features to the CSS editor in Visual Studio.

EditorConfig Language Service   1.17.207Language service for .editorconfig files.

EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs.

Error Catcher II   1.2.9The easiest way to make sure not to miss any errors or warnings in any code file.

Extensibility Tools   1.10.188Contains numerous tools and helpers that makes it easier than ever to build Visual Studio extensions.

File Icons   2.7Adds icons for files that are not recognized by Solution Explorer

File Nesting   2.6.67Automatically nest files based on file name and enables developers to nest and unnest any file manually

GhostDoc   5.6.17190.0Generate XML Comments from your code, maintain clean and up-to-date documentation, produce help documentation in multiple formats, use intelligent source code Spell Checker in Visual Studio.

GitHub.VisualStudio   2.2.0.11A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

HTML Tools   1.0.3Productivity tools for the HTML editor

Image Optimizer   3.6.103Uses industry standard tools to optimize any JPEG, PNG and Gifs - including animated Gifs. Can do both lossy and lossless optimization.

Image Sprites   1.4.47Boost your website's performance by creating image sprites to reduce the amount of HTTP requests needed.

Indent Guides   15Indent Guides

Adds visual guides at each indentation level.

ITweakMyBuild Visual Studio Extension   1.0.4.0ITweakMyBuild let's you customize your build on the fly.

JavaScript Language Service   2.0JavaScript Language Service

JavaScript Transpiler   0.9.24The simplest way to transpile JS and JSX to EcmaScript 5 without any complicated node.js tools in your project. It uses the TypeScript compiler behind the scenes.

JetBrains ReSharper Ultimate 2017.1.3    Build 108.0.20170613.154143JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2017 JetBrains, Inc.

KofePackagePackage Extension   1.0KofePackagePackage Visual Studio Extension Detailed Info

Markdown Editor   1.11.214A full featured Markdown editor with live preview and syntax highlighting. Supports GitHub flavored Markdown.

Merq   1.1.17-rc (cba4571)Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft Azure Hive Query Language Service   2.2.5000.0Language service for Hive query

Microsoft Azure Tools   2.9Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.50131.1

Microsoft MI-Based Debugger   1.0Provides support for connecting Visual Studio to MI compatible debuggers

Mono Debugging for Visual Studio   Mono.Debugging.VisualStudioSupport for debugging Mono processes with Visual Studio.

NuGet Package Manager   4.2.0NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Open Command Line   2.1.179Opens a command line at the root of the project. Support for all consoles such as CMD, PowerShell, Bash etc. Provides syntax highlighting, Intellisense and execution of .cmd and .bat files.

Package Security Alerts   1.0.17Identifies npm and Bower packages that contains known security vulnerabilities to ensure your project is always using the most secure package versions.

Project File Tools   1.0.1Provides Intellisense and other tooling for XML based project files such as .csproj and .vbproj files.

Redgate ReadyRoll   1.14.9.4465Extend DevOps processes to your SQL Server databases and safely automate database deployments.    Visit https://www.red-gate.com/readyroll for more information.

Copyright (C) 2011 Red Gate Software Ltd. All rights reserved.  This software contains components from Component Owl.SQL Server is a registered trademark of Microsoft Corporation. Visual Studio is a registered trademark of Microsoft Corporation.

ReadyRoll contains code from the following open source software:

NuGet https://www.nuget.org/SQL LocalDB Wrapper https://github.com/martincostello/sqllocaldbAutofac https://autofac.org/Json.NET https://json.net/MahApps.Metro http://mahapps.com/SemVer https://github.com/maxhauser/semverLog4Net http://logging.apache.org/log4net/Extended WPF Toolkit https://wpftoolkit.codeplex.com/Code InfoBox VSX http://www.codeproject.com/Articles/55196/Code-InfoBox-Visual-Studio-Extension-VSXOctoPack https://github.com/OctopusDeploy/OctoPackSQLite https://sqlite.org/

This product contains icons from http://www.visualpharm.com distributed under a free backlink license.

For license details or other notices relating to the above software, please see NOTICE.TXT and EULA.rtf in the ReadyRoll application folder.    

Redgate SQL Prompt   8.0.2.1513Write, format, and refactor SQL effortlessly

Reset Zoom   1.1.10Adds a command to reset the editor zoom level to 100% with a customizable keyboard shortcut

SQL Server Data Tools   15.1.61702.140Microsoft SQL Server Data Tools

Syntax Highlighting Pack   2.7.125Adds syntax highlighting and snippet support for a wide variety of programming languages such as Clojure, Go, Jade, Lua, Swift, Ruby and many more...

ToolWindowHostedEditor   1.0Hosting json editor into a tool window

TypeScript   2.2.2.0TypeScript tools for Visual Studio

TypeScript Definition Generator   1.0Creates and synchronizes TypeScript Definition files (d.ts) from C#/VB model classes to build strongly typed web application where the server- and client-side models are in sync. Works on all .NET project types

Viasfora   3.5.139Add color to your Visual Studio editor!

VSColorOutput   2.5.1Color output for build and debug windows - http://mike-ward.net/vscoloroutput

Vue.js Pack 2017   1.1.8Contains HTML Intellisense and code snippets for the Vue.js JavaScript library

Web Compiler   1.11.326Compiler for LESS, Sass and CoffeeScript files

Web Extension Pack 2017   15.0.2The easiest way to set up Visual Studio for the ultimate web development experience.

Xamarin   4.5.0.486 (fec6f88)Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK   7.3.1.2 (9dbc4c5)Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK   10.10.0.37 (ad35de4)Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

ZenCoding   1.2.11Provides ZenCoding for the HTML Editor - full support for static HTML, Razor and WebForms.

resharper-support.jetbrains.com

Alternative ReSharper functionality within Visual Studio 2017

Visual Studio 2017 is finally here and I’ve been using it since it went public. There’s many features to discover and among them are some improvements in code navigation and refactoring which is what I’m covering in this post.

To me the the thing that stands out the most is the CTRL+T key binding, which is ReSharper’s binding for “Go To Everything”. Whether that’s a nod to the ReSharper team or just a nice feature for developers moving from one environment to another is anyone’s guess. In any case,  it doesn’t matter. Some developers I’ve spoken to have all said the same sort of thing, and that is, Microsoft is “taking on” ReSharper. For me nothing could be further from the truth. For me it’s about making the experience more approachable and if that means getting some inspiration from another product then that’s totally OK. This just makes the out-of-the-box experience more enjoyable, especially for those using the community edition.

Go To Everything aka “Go To All”

The feature I use 99% of the time in ReShraper is “Go To Everything”. A similar feature has existed in Visual Studio since 2010 and was named “Navigate To”. VS2017 now comes with a much better version, named “Go To All” and is bound to the keyboard shortcut CTRL + T as well as CTRL + , and includes inline filtering and “fuzzy search”. Like ReSharper, you can enter in partial names of classes or methods. For example, you could enter something like  “co wri” to search for “Console” and “Writer” and be presented with possible matches.

It’s not exactly centre screen which means it takes your eyes away from the code, but it’s a minor thing. There is one aspect which I like over ReSharper’s implementation, and that is it gives you inline help to filter on what you want to search. In ReSharper you’d typically do a CTRL + SHIFT + T to find Types or SHIFT+ALT+T to find Files. In this interface you can do it all from the one and without a separate shortcut.

Combining those filters with the example I presented above, you can add a filter to that fuzzy search. In this example I’m only interested in types, so I prefix the search with a t.

One thing Go To All can’t do, which ReSharper can, is specify a class name and the line number, such as ProductRepository:25 or even ProductRepository 25. It will then open that file and go to that line number. In Go To All, you can go to a line in the current file by typing :123.

For reference here’s what Navigate To it used to look like in earlier versions of Visual Studio.

Visual Studio 2015

Other ReSharper Goodies

Not an exhaustive list, but my frequently used favourites.

  • Filtered types and members can also include library types
    • If library types are found, clicking on them opens the decompiled source code
  • Go to class or interface with line number
  • Go to member in the current file (CTRL + \)

Visual Studio Features

  • Filtering by prefixing searches with a character
  • Fuzzy searching
  • All in one search across files, types and members

Update 2017-04-25

An update to ReSharper version 2017.1 now implements inline filtering just like Visual Studio by prefixing the search with a forward slash /.

Go To Implementation

Although I covered this in my last post, it’s worth another mention as the UI has been improved. If you press CTRL+F12 on a class or interface in Visual Studio, it will now show you a code snippet of the implementation. In VS2015 it only showed the file, line number and class name of the implementation.

Visual Studio 2017

You can then choose how to group them.

For reference here’s what it used to look like.

Visual Studio 2015

Find all references

This one I also covered in my last post, but once again, the UI has had a face-lift.

Pressing SHIFT+F12 now opens up a listing of types, files or properties. It depends what you’re finding a reference to.

In this example I placed my cursor on the set accessor of an Email property and got nice listing with a code snippet. Awesome. This is closer to how ReSharper displays its detailed find, which is also SHIFT+F12.

One thing to note here is that previous versions of Visual Studio didn’t let you find references based on the set or get accessor of a property, although ReSharper has had this for quite some time.

Visual Studio 2017

You can then choose how to group them.

For reference here’s what it used to look like.

Visual Studio 2015

Extract Method

Covered in my last ReSharper post, the extract method has had a face-lift, and like ReSharper, can be accessed with CTRL+R, CTRL+M.

This one caught me out a little. When you first press the shortcut keys it will instantly extract the code out into a new method called NewMethod but then another dialog appears which allows you to rename the method and then preview changes. From here you can choose to not modify parts of the code with the new method name which is very odd.

In this example I’ve renamed the method to FooMethod but I’ve chosen not to rename the code which calls it, which would generate a compile time error. I might be missing something here but I can only see one or two use cases where I would want to do this.

Visual Studio 2017

For reference here’s what it used to look like.

Visual Studio 2015

Final Words

I’ve only scratched the surface on the improvements in Visual Studio. It definitely gives beginners or people who don’t have the money for a ReSharper license a better out-of-the-box experience.

Like this:

Like Loading...

Related

www.depthinfinity.com

.NET Tools Blog - JetBrains tools for .NET developers and Visual Studio users.NET Tools Blog

Rider comes with a powerful debugger for .NET (and JavaScript) which can be attached to a new or existing process. It lets us place breakpoints to pause the application and inspect variables, the current call stack and so on. In Rider 2017.2, we’ve added several features to make debugging with lambda’s more enjoyable.

Note: make sure to check out our series about Rider’s debugger!

Lambda expression breakpoints

When placing a breakpoint on a line with multiple statements, for example where one is a lambda expression, Rider will ask us whether we want to pause program execution on the entire statement, or just on the lambda:

Continue reading →

Posted in How-To's | Tagged debugger, Rider |

Over the past days, we have been blogging about ReSharper support for C# 7.0 and C# 7.1.

Today, let’s conclude with a final part around how ReSharper understands the new syntax and constructs that C# 7.0 and C# 7.1 bring, and ties them into existing and new inspections, quick-fixes, navigation and refactorings.

In this series:

Continue reading →

Pattern matching with generics (spec) is another great topic for our blog series about support for C# 7.0 and C# 7.1 in ReSharper (and Rider)! Using pattern matching, we can combine a type check with a cast, removing some language ceremony. Let’s see how ReSharper can help us with its inspections, quick-fixes and context actions.

In this series (we will update the table of contents as we progress):

Continue reading →

ReSharper Ultimate tools have just entered yet another pre-release cycle: please welcome ReSharper Ultimate 2017.3 EAP!

Here’s a few things that the first 2017.3 EAP build adds:

  • Updated code formatter, including new formatting options and fixes, notably for C# and HTML, as well as control of formatting settings via file masks from .editorconfig and via comments.
  • New typing assists for multi-line comments and chained method calls in C#.
  • C# 7 support extended with a code generation action that creates deconstructors from selected fields or properties.
  • Better presentation of Find Usages results with regard to multi-line method invocations.
  • New context actions, code inspections, and formatting options, as well as language support improvements in ReSharper C++.
  • Support for async/await and Tasks, as well as reworked backtrace presentation in dotTrace.

For your reference, here are lists of issues fixed in ReSharper and ReSharper C++.

We’ll keep you updated as new builds are published, and we’ll talk about significant updates in more detail. Meanwhile, please download ReSharper Ultimate 2017.3 EAP.

ReSharper 2017.1 and 2017.2 bring better support for C# 7.0 and C# 7.1, with a number of new inspections, quick-fixes and context actions. In this 6th part of our blog series, let’s cover how ReSharper (and Rider) work with tuples and how they help with inferring tuple names (spec) in our code. Tuples have been around for a while, and keep evolving in both C# as well as in ReSharper’s features that you know and love.

In this series (we will update the table of contents as we progress):

Continue reading →

As part of our blog series about ReSharper support for C# 7.0 and C# 7.1, let’s talk about the default literal (spec) which was added to C# 7.1. It lets us initialize variables in our code regardless of these variables being value types or reference types. ReSharper adds inspections, quick-fixes and context actions around this new language feature.

In this series (we will update the table of contents as we progress):

Continue reading →

Many developers have been wishing for an async main method to be able to use async/await constructs in console-based applications. The good news is that C# 7.1 introduces support for this (spec)! ReSharper (and Rider) do so, too.

Let’s continue our blog series about ReSharper support for C# 7.0 and C# 7.1 with an episode that covers how ReSharper handles this new keyword.

In this series (we will update the table of contents as we progress):

Continue reading →

Today, we continue our blog series on ReSharper support for C# 7.0 and C# 7.1. The previous post touched on throw expressions (spec) and ReSharper’s inspections, quick-fixes and context actions around these language features.

Today, let’s talk about expression-bodied methods, properties, local functions, constructors, destructors and event accessors. Or in short: expression-bodied “everything”!

In this series (we will update the table of contents as we progress):

Continue reading →

Let’s continue our blog series about ReSharper support for C# 7.0 and C# 7.1! We’ve already blogged about how ReSharper (and Rider) handle out variables, today we’ll look at throw expressions (spec) that are available in C# 7.0.

Throw expressions allow us to throw exceptions from almost any expression, making our code more concise and readable. ReSharper adds inspections, quick-fixes and context actions around these language features.

In this series (we will update the table of contents as we progress):

Continue reading →

Back in February, we wrote a State of the union about ReSharper C# 7 support, based on ReSharper 2016.3. Since then, a number of improvements have been made, both to C# as well as ReSharper (and Rider, which gets language support updates from ReSharper for free).

ReSharper 2017.1 and 2017.2 both bring better support for C# 7.0 and C# 7.1, with a number of new inspections, quick-fixes and context actions. ReSharper understands the new syntax and constructs that C# 7.0 and C# 7.1 bring, and ties them into existing and new inspections, quick-fixes, navigation and refactorings:

  • Binary literals (spec) and digit separators (spec) – see here for ReSharper features (C# 7.0)
  • Local functions (spec) – see here for ReSharper features (C# 7.0)
  • out variable declarations (spec) (C# 7.0)
  • throw expressions (spec) (C# 7.0)
  • Expression-bodied “everything” (C# 7.0)
  • async main methods (spec) (C# 7.1)
  • default literal (spec) (C# 7.1)
  • Inferring of tuple names (spec) (C# 7.1)
  • Pattern matching with generics (spec) (C# 7.1)

Let’s start a blog series on how these language features translate to ReSharper and Rider (we will update the table of contents as we progress):

Continue reading →

blog.jetbrains.com


Смотрите также