ReSharper 2024.1

Released: Apr 9, 2024

2024.1 での更新項目

機能

C# Support

  • More conversions to collection expressions - You will now get suggestions to convert more code constructions in your source code to collection expressions from C# 12, such as an empty array or the ImmutableArray declaration and initialization.
  • Collection was modified analysis - Added the new Possible 'System.InvalidOperationException: Collection was modified' inspection, which will warn you when a collection was modified while iterating inside foreach loops, since this modification might lead to an exception in runtime. This analysis is aware of cases when there is an exit from the loop after a collection's modification, and these cases won't trigger the warning. The inspection comes with a corresponding quick-fix to help you solve this issue instantly.
  • Generate | Formatting Members update - Generate | Formatting Members allows you to generate boilerplate code to override the ToString() method and return a meaningful string for your types. Starting from this version, this feature supports more types, such as ISpanFormattable, IUtf8SpanFormattable, and IFormattable.
  • Enhanced support for disposable resources in async methods
    • [MustDisposeResource] Annotation improvements: C# code analysis now ensures that resources returned by async methods, including those wrapped in Task<IDisposable> and ValueTask<IDisposable>, are disposed of correctly, helping you avoid unintended disposal of the task itself.
    • Task-like return values: Correct analysis for task-like return values in this version ensures the awaited resource is checked for disposal and also includes resources retrieved via .ConfigureAwait(...), .AsTask(), or .Result.
  • Updates to the Change Signature refactoring - Here are some of the improvements that have been made to the Change Signature refactoring:
    • The refactoring now supports Deconstruct methods. You can add, remove, rearrange, and rename parameters, and these changes will be reflected in both the method declaration and its usages.
    • Code completion is now available for type parameters. This means that when you need to specify a type for a List<>, for example, you can use code completion to easily select the desired type, such as int.
    • Type namespaces are now automatically shortened when adding or updating parameters. This helps keep the code clean and simplified after applying the refactoring.
    • The refactoring now supports more features from the last versions of C#, such as in and ref readonly modifiers and record types.
  • Updates to the Make Static refactoring - In this release, the Make Static refactoring supports primary constructor parameters. They appear in the Introduce parameters list and have a separate icon to help you distinguish them easily. This refactoring is also available for local functions.
  • Support for the protobuf-net library - Code Analysis now provides support for the ProtoContract attribute and ImplicitFields enum from the protobuf-net library. Both of these can be used to mark members that are implicitly used for serialization. As a result, such members are no longer flagged with unused members warnings.

Razor Support

  • Resolve references for @addTagHelper and @removeTagHelper directives
    • ReSharper now resolves references for assembly names specified within @addTagHelper and @removeTagHelper directives in your Razor views. As a result, you can now benefit from code completion, the ability to find usages, and the ease of code navigation.
    • ReSharper now considers any unresolved assembly names as errors and highlights them in red to bring them to your attention.

C++ Support

  • Notable enhancements in C++ support include:
    • The reworked implementation of C++20 modules improves performance and provides support for internal module partitions.
    • Change Signature offers new features, including the ability to change a parameter type between a pointer, a reference, or a value type.
    • Call Tracking now supports outgoing call chains.
    • You can now easily customize the style of generated documentation comments. Additionally, grammar inspections are available inside documentation comments.
    • Support is now available for Unreal Engine's Slate UI framework.

Performance

  • High resource utilization mode in solution-wide analysis - Improved the memory allocation profile of code analysis activities to minimize the time spent on garbage collection.
  • Faster Rename refactoring - Renaming elements in your code is now faster and more efficient. This change also affects other core components of ReSharper, leading to performance improvements across multiple features, including Find Usages.
  • Faster Move to Another Type refactoring - The performance of the Move to Another Type refactoring for static members has been significantly improved for dealing with large classes.

Code Formatting

  • Improved UX/UI for custom naming rules - The changes should make it easier to work with advanced naming rules and observe any rules that were imported from EditorConfig files.
  • Remove whitespace on blank lines setting - This new formatting setting allows you to either leave or remove whitespace in blank lines.

Decompiler

  • A new dedicated Assembly Diff tool window - This update introduces the new Assembly Diff tool window to ReSharper. There are a couple of changes that come with it:
    • The ability to compare assemblies, NuGet packages, folders, and .zip archives has been moved from the Assembly Explorer to the Assembly Diff tool window.
    • The Diff mode selector and the Compare and Diff Options buttons have been relocated to the Actions bar of the Assembly Diff tool window.
  • Support for the WebCIL packaging format - The decompiler inside ReSharper now supports the WebCIL packaging format for WebAssemblies. The support covers:
    • Decompilation for WebCIL.
    • The ability to view .wasm files in the Assembly Explorer.
    • Metadata subtrees for WASM nodes in the Assembly Explorer, including WASM and WebCIL headers.

Command Line Tools

  • SARIF format becomes the default - Starting with this release, the default output format of InspectCode is SARIF. The XML format will soon be deprecated. Results are still available in XML format in the current version when using the -f="xml" parameter.

Miscellaneous

  • Out-of-process refactoring - Refactored text controls, this refactoring is designed to improve typing and related aspects of editor performance for both ReSharper and Rider.
  • Extension manager - The JetBrains Marketplace plugin feed has adopted a new filtering mechanism that is based on compatibility checks. This means that incompatible plugins are no longer displayed in ReSharper's extension manager.