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!
Eager, Lazy and Explicit Loading with Entity Framework Core
Entity Framework Core (EF Core) supports a number of ways to load related data. There’s eager loading, lazy loading, and explicit loading. Each of these approaches have their own advantages and drawbacks. In this post, let’s have a quick look at each of these ways to load data for navigational prope…
OSS Power-Ups: bUnit – Webinar Recording
The recording of our webinar, OSS Power-Ups: bUnit, with Egil Hansen and Steven Giesel, is available. This was the twelfth 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 webi…
Accelerating Your Testing Workflow with Unit Test Creation and Navigation
Unit tests play an important role in our daily development workflow. They help us ensure our codebase's correctness when writing new functionality or performing refactorings to improve readability and maintainability. In the process, we often create new test files that accompany the p…
Introducing Predictive Debugging: A Game-Changing Look into the Future
With the introduction of debugging tools, software developers were empowered to interactively investigate the control flow of software programs to find bugs in live environments. At JetBrains, we've always strived to improve the art of debugging. Besides the more standard things you expect from a de…