ReSharper Ultimate 2016.2 EAP: Builds 7 and 8
Improvements in surround templates
We have been working towards merging live and surround templates as well as improving the availability of templates.
As of now, each non-file template can be used for generating code, for surrounding code, or for both, which lets you reuse your custom surround templates as live templates and vice versa, reducing their total count.
Another new thing here is that surround templates become available in the completion list, so you can start typing the name of a surround template as soon as a selection is made without pressing any additional shortcuts:
The traditional way of invoking surround templates with Ctrl+E,U (ReSharper | Edit | Surround With Template) is also improved. The problem of too many templates in the Surround With pop-up, previously addressed with the editable ‘quick access list’, is now solved another way: while the pop-up shows all available templates, you can start typing a template name to shrink the list.
Marking language injections with comments
When a string literal contains a formal language, ReSharper can provide its code analysis and assistance features right inside this literal. Since v. 9.0, this has been available for regular expressions, and v. 2016.2 brings support for injected HTML.
Let’s recap how it works. As it’s impossible to automatically detect whether the formal language is intended in the literal, you have to mark the injection explicitly in one of the following ways:
- Use the context action, which actually tells ReSharper to mark the symbol range corresponding to the string as Regexp/HTML, save this range in its internal database and keep track of it as the containing file changes. This way is very quick and straightforward, but there are two downsides: the range can be lost after an external file change, such as a VCS merge, and the injection marked this way will only be tracked locally.
Mark method parameters accepting regular expressions with
RegexPatternAttributefrom JetBrains.Annotations. This is the recommended way for regular expressions in parameters.
- ReSharper 2016.2 introduces a third way: you can put a comment
/*language=html|regexp|jsregexp*/before the string literal. Granted, these comments require some typing and you can even think of them as contaminating your code. However, they make your intention clear to everyone who reads your code, they won’t get lost, and anyone opening your code with ReSharper will get the same features in the marked strings. By the way, the format of comments is compatible with IntelliJ Platform-based IDEs.
More C# typing assistance
In addition to the smart behavior of dot and semicolon inside braces, which
we mentioned previously, ReSharper now automatically corrects mistyped
@$ prefixes for verbatim string interpolations:
Generating abstract members in TypeScript
In TypeScript, you can now generate implementations for abstract members using either the Generate menu (Alt+Insert) or a quick-fix:
Subscribe to Blog updates
Creating Custom AI Prompts
AI has swept through the software development industry like a wildfire. So people want to learn how to best use AI in their day to day tasks. In this post we’ll take a look at how to write custom prompts for use with the JetBrains AI Assistant in ReSharper and Rider so you can make the most of AI.&n…
12 Debugging Techniques In JetBrains Rider You Should Know About
Twelve must know debugging features in JetBrains Rider every developer should know.
Interceptors – Using C# 12 in Rider and ReSharper
Welcome to our series, where we take a closer look at the C# 12 language features and how ReSharper and Rider make it easy for you to adopt them in your codebase. If you haven’t yet, download the latest .NET 8 SDK and update your project files! In this series, we are looking at: Primary …