Code formatting engine updates in ReSharper and Rider
Over the past few ReSharper releases, we completely rewrote our code formatting engine. By doing this rewrite, we are able to iterate and innovate more rapidly.
In the latest ReSharper 2017.3 EAP releases, we have started to build on top of these rewritten foundations, guided by the most-voted feature requests in our issue tracker. Let’s start a blog series and look at the various improvements!
This post is part of a series around changes in the ReSharper and Rider code formatter:
- Code formatting engine updates in ReSharper and Rider
- Different code styles for different blocks of code
- Aligning code in columns
- Configuring code formatting from code selection
New code formatting options in ReSharper and Rider 2017.3
For example in ReSharper C++, we can now configure outdenting for
-> in chained method calls, and for commas. For HTML, there are new options for configuring linebreaks before multiline elements or even before all elements.
Both ReSharper 2017.3 EAP and Rider 2017.3 EAP come with a large number of existing and new code formatting options. Here’s a list of some of the new options:
- All languages (C#/C++/JS/TS/HTML/Protobuf)
- Disable/enable/change settings for code formatter with comments
- Disable formatter using
.editorconfigfile masks that have
- Option to keep extra space inside (to respect user alignment around existing
- Alignment in columns inside code
- Options to outdent binary operators, dots and commas
- Option “Nested ternary expression style”
- Option to insert blank lines before/after statements: depending on their contents
- Improve alignment of nested binary expressions and chained method calls
- Line Breaks and Wrapping options to place attributes on same line/previous line, specify arrangement of attributes, …
- Options to specify single-line/multi-line formatting for expression-bodied members
- Options for embedded blocks of code
- HTML formatter has new options for linebreaks before multiline elements or even before all elements
- C++ adds outdenting for
->in chained method calls, and for commas
And many, many more! In the next post, we’ll look at two awesome new features made possible by our code formatter rewrite: disabling/enabling/configuring the code formatter for different blocks of code, and chopping long lines of code.
Download ReSharper 2017.3 EAP and give it a try! We’d love to hear your feedback!
Subscribe to Blog updates
Thanks, we've got you!
Another Look into the Future with Rider’s Predictive Debugger
In the 2023.2 release cycle, we’ve introduced the Predictive Debugger in ReSharper, which gives you predictions about code paths and variables beyond the current execution pointer. We’ve written extensively about its advantages compared to alternative debugging strategies like thorough thinking, log…
Visualize Entity Framework Relationships and Additional Query Analysis in ReSharper 2023.3
A lot of teams are using Entity Framework or EF Core to work with their database. As an Object-Relational Mapper (ORM), it bridges objects in code to a relational database model, so that as a developer you don’t have to worry too much about the actual database. We all know: that’s not entirely tr…
Automatically Analyze ASP.NET Core Performance With Dynamic Program Analysis
Slow web pages may make your users or customers abandon your web application, even before they’ve had a proper look at it. You’ve likely also been frustrated working with a web application that is slow to load. The good news is that the latest versions of ReSharper and JetBrains Rider’s Dynamic P…
OSS Power-Ups: MassTransit – Webinar Recording
The recording of our webinar, OSS Power-Ups: MassTransit, with Chris Patterson, is available. This was the thirteenth episode of our OSS Power-Ups series, where we put a spotlight on open-source .NET projects. Subscribe to our community newsletter to receive notifications about future webinars.…