Inline parameter name hints for C# and VB.NET in ReSharper and Rider

When editing code in the latest builds of ReSharper 2018.3 EAP and Rider 2018.3 EAP,  the inline parameter hints for C# and VB.NET are something you will notice immediately. Let’s see how this new feature makes code more readable, and how we can configure it.

What are inline parameter hints?

When using a literal in a method call, ReSharper and Rider will annotate those with the name of the parameter. This makes it much easier to understand what their value represents.

For example, we can see that the string literal "\\s" here, represents the pattern of a regular expression:

Example of inline parameter hints

When hovering an inline parameter hint in ReSharper, we’ll also display XML documentation when available:

Display XMLDoc on hover

One place where inline parameter hints become very useful, is when passing in null values or booleans. What do the null and false arguments represent here?

var people = peopleService.Find("Maarten", null, false);

The meaning of these becomes clear immediately when using inline parameter hints, without having to rely on using named arguments for readability:

Inline parameter hints for null and boolean values

When are inline parameter hints shown?

Generally speaking, ReSharper and Rider will display inline parameter hints for literals and null values, lambda and array expressions, anonymous methods and object creation expressions, constants and enumeration values.

ReSharper and Rider do not display inline parameter hints for all literals and null values, however. Many base class library (BCL) methods have an obvious name and functionality, and displaying inline parameter hints would not improve readability for these.

For example, in the following cases, the meaning of all parameters becomes clear from looking at their usage:

No parameter hints when obvious or natural

Showing (or not showing) inline parameter hints can be configured in ReSharper’s settings, under Environment | Editor | Inline Hints: C# & VB.NET. Similarly in Rider, we can configure these under Editor | Parameter Name Hints | C# and Visual Basic .NET.

Configuring inline parameter hints

Disable inline parameter hints can be done from the settings as well. A quick way to enable/disable parameter hints is by using the status indicator context menu:

Status indicator context menu

In some cases, it may be useful to disable inline parameter hints for a certain method call. This can be done using the Configure Parameter Name Hints action (Alt+Enter):

Configure Parameter Name Hitns - Hide for specific method

Once applied, the method will be added to the exclude list in the settings:

Do not show parameter hints for method - exclude list

If we want to re-enable parameter hints for the Regex.Split() method, we can drop the entry from this list. We could also expand the entry here, and add additional namespaces and methods where inline parameter hints should be disabled.

Download ReSharper 2018.3 EAP or Rider 2018.3 EAP and give it a try! We’d love to hear your feedback!

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

Renaming projects the easy way – new refactoring in Rider 2018.3

We all have experienced the effort and time it takes to rename a project in a solution. We have to update folder and file names, adjust namespaces, fix various references, and usually yell at our computer to make things work. All that work takes a lot of iterations and can be frustrating.

What if the IDE could do that work for us? The latest Rider 2018.3 EAP build comes with the rename project refactoring! Let’s now look at the details.
Continue reading

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

Named tuple inference, leading digit separator, non-trailing named arguments – VB.NET 15.3 and 15.5 language features in ReSharper and Rider

A while ago, we did a blog series about C# 7.0, 7.1, 7.2, and C# 7.3 language features. It’s high time we did something similar for VB.NET!

The latest ReSharper 2018.3 EAP and Rider 2018.3 EAP come with VB.NET 15.3 and 15.5 language support for named tuple inference, the leading digit separator, non-trailing named arguments, and the Private Protected access modifier. Let’s have a look at them, shall we? Continue reading

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

Using .NET Core launchSettings.json to run/debug apps in Rider

A .NET Core application can have a file called launchSettings.json, which describes how a project can be launched. It describes the command to run, whether the browser should be opened, which environment variables should be set, and so on. This information can then be used by dotnet to run or debug our application.

The latest Rider 2018.3 Early Access Preview (EAP) build adds support for generating Rider run/debug configurations from launchSettings.json. This makes the launch profile portable between the command-line dotnet tools and Rider. Let’s see how this works! Continue reading

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

Refactor Now or Never – Webinar Recording

The recording of our October 31 webinar with Dino Esposito is now available.

The same popular metaphor of unit-testing – write the test, break it, fix it – can be applied at a higher level of abstraction to improve the average quality of your codebase just as you code.

Continue reading

Posted in How-To's | Tagged , , , , | Leave a comment

SQL inside C# strings, fragment editor, run query in console – Language injection updates in Rider 2018.3

The latest Rider 2018.3 EAP build extends Rider’s language injections functionality quite a bit, with SQL language support in string literals. This gives us highlighting, code completion and code analysis, and a Run in console action for SQL inside of a C# string!

For all existing and newly added language injections, we can edit fragments in a separate editor! And last but not least, we can now configure automatic language injections, so that Rider automatically recognizes language fragments inside strings.

More than enough for a long blog post! Grab a coffee or tea, sit back, and let’s dive in! Continue reading

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

Rider 2018.3 assembly explorer and cross-platform .NET decompiler

Rider has had support for decompiling .NET assemblies for a while (including debugging), but it only allows decompiling assemblies referenced in our solution.

The latest Rider 2018.3 Early Access Preview (EAP) changes this, and comes with a built-in assembly explorer, which lets us drill into namespaces, types and type members for any assembly. Essentially, this makes Rider’s assembly explorer a cross-platform .NET decompiler that works on Windows, Mac OS X and Linux, based on dotPeek.

For referenced assemblies, we can use the View in Assembly Explorer context action to open the assembly explorer:

View in Assembly Explorer

Another way to open it, is by changing the view of the Solution Explorer tool window – it’s more than just a Solution Explorer! Continue reading

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

Performance profiling .NET code in Rider with integrated dotTrace

Rider 2018.2 was the first release to host one of our .NET tools, dotCover, together with its unit test coverage features. As we mentioned back then, this was just the beginning. Today, it’s performance profiling’s turn to be taken on board. We are proud of our first Rider release with an integrated performance profiler: JetBrains dotTrace is now part of the latest Rider 2018.3 EAP build!

In this introductory post, let’s take a look at the profiler’s capabilities, supported systems and frameworks, and licensing.
Continue reading

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

Unity-specific code analysis in Rider 2018.2

Perhaps the most powerful feature that Rider has is its code analysis, finding issues and providing quick fixes and context actions to help you improve the quality of your code. Rider’s Unity support is no exception, and in this post, we’ll take a look at what Rider 2018.2 brings in terms of Unity-specific code analysis and refactorings.

Continue reading

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

Deploy web apps, explore resources and more – Introducing the Azure Toolkit for Rider

Today, we are happy to introduce the Azure Toolkit for JetBrains Rider – an open-source plugin that helps .NET developers easily create, develop, configure, test, manage and deploy web apps to Azure directly from within Rider, and work with resources such as storage, Redis cache and virtual machines.

TL;DR: Get the plugin for Rider 2018.2, install it, explore your Azure resources and deploy a Web App!

Microsoft Azure Toolkit for Rider - Manage your Azure Resources and deploy Web Apps

Let’s dive in and look at the Azure Explorer tool window and its functionality, as well as deploying ASP.NET web apps to Azure from within Rider! Continue reading

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