Code completion improvements in Rider 2018.2 EAP

In our latest Rider 2018.2 EAP (Early Access Preview) build, we made a number of improvements to code completion. The scoring engine from R# is now being used, resulting in better code suggestions. We’ve added code completion for scratch files, debugger watches, and C# Interactive. If you are working with unsafe code, we will replace . with the required -> member access operator. And of course we made some bugfixes, too. Let’s have a look!

Better code suggestion scoring

Starting with the Rider 2018.2 EAP, we are using the ReSharper statistics-based scoring algorithm to provide code completion. One of the key aspects is that Rider now keeps track of how many times a given code suggestion was used. The more a suggestion is used, the more likely it will show up in code completion.

In the following example, we’ve used Console.WriteLine() a number of times. Code completion will start suggesting this as the first entry on the Console type:

Better code completion in Rider 2018.2

For many cases, this will provide better code completion than before.

Code completion for scratch files, debugger watches and C# Interactive

We’ve added code completion to several places where it would be handy to get some help from Rider: scratch files, debugger watches and C# Interactive.

Code completion in debugger watches

Just like when writing code in a regular C# or VB.NET file, Rider provides code completion as well as method info and parameter hint popups.

Unsafe member access operator completion

C# does not allow us to use pointer arithmetic by default, to ensure type safety and security in our code base. However, we can use the unsafe keyword to define an unsafe context where this is possible. In such unsafe context, we can work with pointers, much as we can in unmanaged languages.

To access a pointer type’s members, the -> operator must be used instead of the . we’re used to from regular C# code. To help our mind while writing unsafe code, Rider will detect when we use the wrong operator and when completing code, use the correct one:

Rider unsafe member access operator code completion

Bugfixes

Several bugs and corner cases were fixed. Code completion is now available in hot spots, e.g. while using live templates. We fixed some odd code suggestions, for example when working with #region directives.

Download Rider 2018.2 EAP now! We’d love to hear your feedback on these improvements!

This entry was posted in How-To's and tagged , , , , , . Bookmark the permalink.

6 Responses to Code completion improvements in Rider 2018.2 EAP

  1. Mateusz says:

    Any news on remote debugging? (RIDER-738)

  2. Smad says:

    1) code completion in C# Interactive doesn’t work when i loaded assembly with namespace via “c# interactive”->”tool arguments” https://www.screencast.com/t/huwStHVl
    2) 182.3944.370, 182.4129.54 stopped indexing the solution and old projects, found workaround, i added folder to index by force via explorer->Filesystem
    3)182.4129.54 can’t import rider profile from 182.3944.370, just suggest create new profile.

  3. Pingback: The Morning Brew - Chris Alcock » The Morning Brew #2641

Leave a Reply

Your email address will not be published. Required fields are marked *