{"id":525492,"date":"2024-11-12T16:26:18","date_gmt":"2024-11-12T15:26:18","guid":{"rendered":"https:\/\/blog.jetbrains.com\/?post_type=dotnet&#038;p=525492"},"modified":"2025-04-09T08:11:20","modified_gmt":"2025-04-09T07:11:20","slug":"csharp-language-support-in-resharper-and-rider-2024-3","status":"publish","type":"dotnet","link":"https:\/\/blog.jetbrains.com\/zh-hans\/dotnet\/2024\/11\/12\/csharp-language-support-in-resharper-and-rider-2024-3","title":{"rendered":"C# Language Support in ReSharper and Rider 2024.3"},"content":{"rendered":"\n<p>Our upcoming 2024.3 release marks a <b>huge milestone<\/b> for our development process but <em>especially<\/em> for our users. <b>ReSharper and Rider 2024.3 will be<em> <\/em><a href=\"https:\/\/lingoport.com\/i18n-term\/simship\/\" target=\"_blank\" rel=\"noopener\">simshipped<\/a> along with .NET 9 and C# 13!<\/b> Yes, you heard right\u2014no more waiting an extra few weeks or using our EAP builds to take advantage of the latest and greatest C# of all time. If all goes well (UPD: We&#8217;ve made it!), you can enjoy your most loved language in your most loved IDE starting tomorrow!<\/p>\n\n\n<div class=\"buttons\">\n<div class=\"buttons__row\">\n<a href=\"https:\/\/www.jetbrains.com\/rider\/download\/\" class=\"btn\" target=\"\" rel=\"noopener\">Download Rider 2024.3<\/a> <a href=\"https:\/\/www.jetbrains.com\/resharper\/download\/\" class=\"btn\" target=\"\" rel=\"noopener\">Download ReSharper 2024.3<\/a><\/div>\n<\/div>\n\n\n<p>In this blog post, we will cover new features that have been added to our C# language support over the 2024.3 release cycle. Note that some C# 13 features have already been covered in the 2024.2 release, including <a href=\"https:\/\/blog.jetbrains.com\/dotnet\/2024\/08\/07\/escape-character-extract-common-code-params-modifier-out-vars-csharp-language-support-in-2024-2\/\">escape characters<\/a> and <a href=\"https:\/\/blog.jetbrains.com\/dotnet\/2024\/08\/08\/equality-analysis-ref-structs-culture-previews-using-directives-csharp-language-support-in-2024-2\/\">ref struct interfaces<\/a>. Make sure to check out our <a href=\"https:\/\/blog.jetbrains.com\/dotnet\/2024\/08\/07\/escape-character-extract-common-code-params-modifier-out-vars-csharp-language-support-in-2024-2\/\">three-part series<\/a> if you&#8217;ve missed it!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Partial Properties<\/h2>\n\n\n\n<p>One of the most anticipated features in C# 13 are <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/csharp\/language-reference\/keywords\/partial-member\" target=\"_blank\" rel=\"noopener\">partial properties<\/a>. Previously, the concept of partial members was limited to types and methods. While partial types (classes, structs, records) mainly help organize your code into multiple parts and avoid cluttered single files, partial members allow you to define a single member (methods, properties, indexers) in any of these parts with only one part implementing it. This concept becomes particularly powerful in combination with <a href=\"https:\/\/github.com\/dotnet\/roslyn\/blob\/main\/docs\/features\/incremental-generators.cookbook.md\" target=\"_blank\" rel=\"noopener\">source generators<\/a> that automatically provide the correct and optimized implementation based on your member definitions:<\/p>\n\n\n                        <div class=\"rider-code-highlight rider-code-highlight__dark\">\n                <pre><code><span class=\"comment\">\/\/ User code<\/span>\r\n<span class=\"keyword\">public<\/span> <span class=\"keyword\">partial<\/span> <span class=\"class-name\">Person<\/span> : <span class=\"class-name\">INotifyPropertyChanged<\/span>\r\n{\r\n    [<span class=\"class-name\">JsonPropertyName<\/span>(<span class=\"string\">\"custom-name\"<\/span>)]\r\n    <span class=\"keyword\">public<\/span> <span class=\"keyword\">partial<\/span> <span class=\"keyword\">string<\/span> <span class=\"property-name\">Name<\/span> { <span class=\"keyword\">get<\/span>; <span class=\"keyword\">set<\/span>; }\r\n}\r\n\r\n<span class=\"comment\">\/\/ Generated code<\/span>\r\n<span class=\"keyword\">partial<\/span> <span class=\"property-name\">Person<\/span>\r\n{\r\n    <span class=\"comment\">\/\/ More attributes allowed!<\/span>\r\n    <span class=\"keyword\">public<\/span> <span class=\"keyword\">partial<\/span> <span class=\"keyword\">string<\/span> <span class=\"property-name\">Name<\/span>\r\n    {\r\n        <span class=\"keyword\">get<\/span> <span class=\"operator\">=&gt;<\/span> <span class=\"keyword\">field<\/span>;\r\n        <span class=\"keyword\">set<\/span> <span class=\"operator\">=&gt;<\/span> <span class=\"method-name\">SetField<\/span>(<span class=\"keyword\">ref<\/span> <span class=\"keyword\">field<\/span>, <span class=\"keyword\">value<\/span>);\r\n    }\r\n    <span class=\"comment\">\/\/ ...<\/span>\r\n}<\/code><\/pre>\n                <div class=\"rider-code-highlight-btn-copy\"><div class=\"rider-code-highlight-tooltip\">Copy to clipboard<\/div><\/div>\n            <\/div>\n            \n\n\n\n\n\n\n<p>With ReSharper and Rider 2024.3, we are adding support for partial properties syntax and updating our code highlightings and generators. For instance, you can generate property definitions through:<\/p>\n\n\n\n<ol>\n<li>The <em>Implement property in another part of class<\/em> quick-fix\n\n<figure class=\"wp-block-image is-resized is-style-default aligncenter\">\n    <img\n        src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/implementing-a-partial-property-in-another-part-of-the-type.jpg\"\n        data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/implementing-a-partial-property-in-another-part-of-the-type.gif\"\n        alt=\"Implementing a partial property in another part of the type\"\n        width=\"660\"\/>\n    <figcaption class=\"wp-element-caption\">Implementing a partial property in another part of the type<\/figcaption>\n<\/figure>\n<\/li>\n\n\n\n<li>The <a href=\"https:\/\/www.jetbrains.com\/help\/rider\/Code_Generation__Partial_Methods.html\" target=\"_blank\" rel=\"noopener\"><em>Generate Partial Members<\/em><\/a> action from the <kbd>Alt<\/kbd>+<kbd>Enter<\/kbd> menu\n\n<figure class=\"wp-block-image is-resized is-style-default aligncenter\">\n    <img\n        src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/generating-multiple-partial-properties.jpg\"\n        data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/generating-multiple-partial-properties.gif\"\n        alt=\"Generating multiple partial properties\"\n        width=\"660\"\/>\n    <figcaption class=\"wp-element-caption\">Generating multiple partial properties<\/figcaption>\n<\/figure>\n<\/li>\n\n\n\n<li>The code completion after typing <code>partial<\/code>\n\n<figure class=\"wp-block-image is-resized is-style-default aligncenter\">\n    <img\n        src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/code-completion-for-missing-partial-properties.jpg\"\n        data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/code-completion-for-missing-partial-properties.gif\"\n        alt=\"Code completion for missing partial properties\"\n        width=\"660\"\/>\n    <figcaption class=\"wp-element-caption\">Code completion for missing partial properties<\/figcaption>\n<\/figure>\n<\/li>\n<\/ol>\n\n\n\n<p>You will also find new and updated context actions to manage existing partial definitions. For instance, you can change the accessibility from one part of a member definition, and it will reflect on all the other parts:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized is-style-default aligncenter\">\n    <img\n        src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/changing-access-modifiers-or-partial-properties.jpg\"\n        data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/changing-access-modifiers-or-partial-properties.gif\"\n        alt=\"Changing access modifiers or partial properties\"\n        width=\"660\"\/>\n    <figcaption class=\"wp-element-caption\">Changing access modifiers or partial properties<\/figcaption>\n<\/figure>\n\n\n\n<p>Or you can <em>merge partial members<\/em> into one definition:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized is-style-default aligncenter\">\n    <img\n        src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/merging-partial-properties-into-one-definition.jpg\"\n        data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/merging-partial-properties-into-one-definition.gif\"\n        alt=\"Merging partial properties into one definition\"\n        width=\"660\"\/>\n    <figcaption class=\"wp-element-caption\">Merging partial properties into one definition<\/figcaption>\n<\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Field Keyword<\/h2>\n\n\n\n<p>The long-awaited <code>field<\/code> keyword for properties is finally coming to C# 13 as a preview feature. Previously, you had to explicitly declare a backing field for every non-trivial property. With the new <code>field<\/code> keyword, you can implement <em>semi-auto-properties<\/em> by referencing the compiler-generated backing field in your custom accessor:<\/p>\n\n\n                        <div class=\"rider-code-highlight rider-code-highlight__dark\">\n                <pre><code><span class=\"comment\">\/\/ Before C# 13<\/span>\r\n<span class=\"keyword\">class<\/span> <span class=\"class-name\">Person<\/span>\r\n{\r\n    <span class=\"keyword\">private<\/span> <span class=\"keyword\">string<\/span> <span class=\"field-name\">_name<\/span>;\r\n    <span class=\"keyword\">public<\/span> <span class=\"keyword\">string<\/span> <span class=\"property-name\">Name<\/span>\r\n    {\r\n        <span class=\"keyword\">get<\/span> <span class=\"operator\">=&gt;<\/span> <span class=\"field-name\">_name<\/span>;\r\n        <span class=\"keyword\">set<\/span> <span class=\"operator\">=&gt;<\/span> <span class=\"field-name\">_name<\/span> <span class=\"operator\">=<\/span> <span class=\"keyword\">value<\/span><span class=\"operator\">.<\/span><span class=\"method-name\">Trim<\/span>();\r\n    }\r\n}\r\n\r\n<span class=\"comment\">\/\/ From C# 13<\/span>\r\n<span class=\"keyword\">class<\/span> <span class=\"class-name\">Person<\/span>\r\n{\r\n    <span class=\"keyword\">public<\/span> <span class=\"keyword\">string<\/span> <span class=\"property-name\">Name<\/span>\r\n    {\r\n        <span class=\"keyword\">get<\/span>;\r\n        <span class=\"keyword\">set<\/span> <span class=\"operator\">=&gt;<\/span> <span class=\"keyword\">field<\/span> <span class=\"operator\">=<\/span> <span class=\"keyword\">value<\/span><span class=\"operator\">.<\/span><span class=\"method-name\">Trim<\/span>();\r\n    }\r\n}<\/code><\/pre>\n                <div class=\"rider-code-highlight-btn-copy\"><div class=\"rider-code-highlight-tooltip\">Copy to clipboard<\/div><\/div>\n            <\/div>\n            \n\n\n\n\n\n\n<p>Once you&#8217;ve added <code>&lt;LangVersion&gt;preview&lt;\/LangVersion&gt;<\/code> to your project file, ReSharper and Rider will recognize the old pattern and offer to <em>Replace with \u2018field&#8217; keyword<\/em>:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized is-style-default aligncenter\">\n    <img\n        src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/replacing-backing-fields-with-the-field-keyword.jpg\"\n        data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/replacing-backing-fields-with-the-field-keyword.gif\"\n        alt=\"Replacing backing fields with the field keyword\"\n        width=\"660\"\/>\n    <figcaption class=\"wp-element-caption\">Replacing backing fields with the field keyword<\/figcaption>\n<\/figure>\n\n\n\n<p>ReSharper and Rider will also help you to <em>Remove redundant bodies<\/em> where the property value is only returned or set:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized is-style-default aligncenter\">\n    <img\n        src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/removing-redundant-bodies-for-accessor-bodies.jpg\"\n        data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/removing-redundant-bodies-for-accessor-bodies.gif\"\n        alt=\"Removing redundant bodies for accessor bodies\"\n        width=\"660\"\/>\n    <figcaption class=\"wp-element-caption\">Removing redundant bodies for accessor bodies<\/figcaption>\n<\/figure>\n\n\n\n<p>With this syntax, some popular patterns involving properties become notably compact. For instance, as part of our<a href=\"https:\/\/www.jetbrains.com\/help\/resharper\/Coding_Assistance__INotifyPropertyChanged_Support.html\" target=\"_blank\" rel=\"noopener\"><code>INotifyPropertyChanged<\/code> support<\/a>, we&#8217;ve updated our <em>To property with \u2018SetField&#8217; change notification<\/em> context action to implement properties more efficiently and easy to read:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized is-style-default aligncenter\">\n    <img\n        src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/implementing-property-change-notifications.jpg\"\n        data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/implementing-property-change-notifications.gif\"\n        alt=\"Implementing property change notifications\"\n        width=\"660\"\/>\n    <figcaption class=\"wp-element-caption\">Implementing property change notifications<\/figcaption>\n<\/figure>\n\n\n\n<p>Another very common pattern is input value validation. While previously, you were forced to implement getter\/setter accessors and declare a backing field, ReSharper and Rider will now allow you to use parameter-checking context actions to convert to a succinct implementation for just the <code>set<\/code> or <code>init<\/code> accessor:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized is-style-default aligncenter\">\n    <img\n        src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/adding-null-checks-for-properties.jpg\"\n        data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/adding-null-checks-for-properties.gif\"\n        alt=\"Adding null checks for properties\"\n        width=\"660\"\/>\n    <figcaption class=\"wp-element-caption\">Adding null checks for properties<\/figcaption>\n<\/figure>\n\n\n\n<p><span style=\"box-sizing: border-box; margin: 0px; padding: 0px;\">To get the most compact formatting layout, make sure to enable&nbsp;<em>Place simple accessor on single line<\/em>&nbsp;in your code style settings<\/span>!<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized is-style-default aligncenter\">\n    <img\n        src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/code-style-settings-for-property-accessors.png\"\n        alt=\"Code style settings for property accessors\"\n        width=\"660\"\/>\n   <figcaption class=\"wp-element-caption\">Code style settings for property accessors<\/figcaption>\n<\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">System.Threading.Lock Type<\/h2>\n\n\n\n<p>In .NET 9, we are getting a new type <code><a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/api\/system.threading.lock?view=net-9.0\" target=\"_blank\" rel=\"noopener\">System.Threading.Lock<\/a><\/code> designed for <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/standard\/threading\/overview-of-synchronization-primitives\" target=\"_blank\" rel=\"noopener\">thread synchronization<\/a>. In C#, you can implement thread synchronization through the <code>lock<\/code> statement over any reference type object. Often, this is done with a private <code>object<\/code> field that is created solely for locking purposes:<\/p>\n\n\n                        <div class=\"rider-code-highlight rider-code-highlight__dark\">\n                <pre><code><span class=\"keyword\">class<\/span> <span class=\"class-name\">LockObject<\/span>\r\n{\r\n    <span class=\"keyword\">private<\/span> <span class=\"keyword\">readonly<\/span> <span class=\"keyword\">object<\/span> <span class=\"field-name\">_syncRoot<\/span> <span class=\"operator\">=<\/span> <span class=\"keyword\">new<\/span>();\r\n\r\n    <span class=\"keyword\">public<\/span> <span class=\"keyword\">void<\/span> <span class=\"method-name\">M<\/span>()\r\n    {\r\n        <span class=\"keyword\">lock<\/span> (<span class=\"field-name\">_syncRoot<\/span>)\r\n        {\r\n            <span class=\"comment\">\/\/ work<\/span>\r\n        }\r\n    }\r\n}<\/code><\/pre>\n                <div class=\"rider-code-highlight-btn-copy\"><div class=\"rider-code-highlight-tooltip\">Copy to clipboard<\/div><\/div>\n            <\/div>\n            \n\n\n\n\n\n\n<p>While technically alright, these <code>object<\/code> fields do not tell how they&#8217;re intended to be used apart from their name. Locking is often performed over existing objects accessible to other locking types, which can have unintended side effects. Firstly, entering the block can be unnecessarily delayed from other classes that lock on the same object. Secondly, since the runtime might have to <a href=\"https:\/\/devblogs.microsoft.com\/premier-developer\/managed-object-internals-part-2-object-header-layout-and-the-cost-of-locking\/\" target=\"_blank\" rel=\"noopener\">promote the lock<\/a> when <code>Object.GetHashCode()<\/code> is called or thread contention happens, the following lock acquisition or release will be slightly more expensive.<\/p>\n\n\n\n<p>The <code>System.Threading.Lock<\/code> was introduced to solve both of the issues described above. It clearly expresses the intent of fields used for locking, while it also avoids performance degradation. In 2024.3, we detect old field synchronization patterns and offer the replacement with the <code>Lock<\/code> type:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized is-style-default aligncenter\">\n    <img\n        src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/converting-to-systemthreadinglock-in-synchronization-patterns.jpg\"\n        data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/converting-to-systemthreadinglock-in-synchronization-patterns.gif\"\n        alt=\"Converting to System.Threading.Lock in synchronization patterns\"\n        width=\"660\"\/>\n    <figcaption class=\"wp-element-caption\">Converting to System.Threading.Lock in synchronization patterns<\/figcaption>\n<\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Merge Switch-Case Sections<\/h2>\n\n\n\n<p>In our last 2024.2 release, we introduced a new quick-fix <a href=\"https:\/\/blog.jetbrains.com\/dotnet\/2024\/08\/07\/escape-character-extract-common-code-params-modifier-out-vars-csharp-language-support-in-2024-2\/#extract-common-code\"><em>Extract Common Code<\/em><\/a>, which can extract common statements from <code>if<\/code> and <code>switch<\/code> statements. In the new 2024.3 release, we are extending this family of code duplication fixes with a new quick-fix to merge duplicated <code>switch<\/code> cases into a single case with broader conditions:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized is-style-default aligncenter\">\n    <img\n        src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/merging-duplicated-switch-section-bodies.jpg\"\n        data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/merging-duplicated-switch-section-bodies.gif\"\n        alt=\"Merging duplicated switch section bodies\"\n        width=\"660\"\/>\n    <figcaption class=\"wp-element-caption\">Merging duplicated switch section bodies<\/figcaption>\n<\/figure>\n\n\n\n<p>As a reminder, these inspections can also hint at code that was <em>supposed<\/em> to be different but ended up unchanged after copy-pasting it. So make sure to carefully investigate each duplication before merging it!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">IDE Tooltips Colorization<\/h2>\n\n\n\n<p>As with every release, we not only focus on supporting new language features but also enhancing existing functionality to ensure our .NET IDEs stay aligned with modern IDE capabilities. In this release, we reviewed nearly all C# errors, warnings, and informational messages to introduce editor-like text colorization wherever possible. Overall, approximately 600 messages were upgraded, making many of the tooltips you see daily more structured and easier to read:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized is-style-default aligncenter\">\n    <img\n        src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/colorization-and-cleanup-of-tooltips.png\"\n        alt=\"Colorization and cleanup of tooltips\"\n        width=\"1320\"\/>\n   <figcaption class=\"wp-element-caption\">Colorization and cleanup of tooltips<\/figcaption>\n<\/figure>\n\n\n\n<p>And this is just the beginning\u2014utilizing the colorization infrastructure, we plan to enhance other error messages, particularly type conversion errors. During the refactoring, we also introduced colorization in various other editor tooltips and popups:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized is-style-default aligncenter\">\n    <img\n        src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/colorization-of-classes-in-missing-references-popup-rider-only.png\"\n        alt=\"Colorization of classes in \u2018missing references\u2019 popup (Rider only)\"\n        width=\"660\"\/>\n   <figcaption class=\"wp-element-caption\">Colorization of classes in \u2018missing references\u2019 popup (Rider only)<\/figcaption>\n<\/figure>\n\n\n\n<figure class=\"wp-block-image is-resized is-style-default aligncenter\">\n    <img\n        src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/colorization-of-classes-in-type-hierarchy-popup-resharper-only.png\"\n        alt=\"Colorization of classes in type hierarchy popup (ReSharper only)\"\n        width=\"660\"\/>\n   <figcaption class=\"wp-element-caption\">Colorization of classes in type hierarchy popup (ReSharper only)<\/figcaption>\n<\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Obsolete and EditorBrowsable<\/h2>\n\n\n\n<p>Over many years, we&#8217;ve been struggling to properly support <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/api\/system.obsoleteattribute?view=net-8.0\" target=\"_blank\" rel=\"noopener\"><code>[Obsolete]<\/code><\/a> and <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/api\/system.componentmodel.editorbrowsableattribute?view=net-8.0\" target=\"_blank\" rel=\"noopener\"><code>[EditorBrowsable]<\/code><\/a> in our code completion. That is mainly because we cannot afford to&nbsp;ask&nbsp;each code entity in a completion list (types, members) about its traits regarding these two attributes. Caching, one of the most obvious solutions, is not well-suited for the source code domain, where code semantics can change drastically with each keypress. However, it can be effective for compiled code from assemblies, though it has the drawback of using more memory and performance on the first read.<\/p>\n\n\n\n<p>In 2024.3, we&#8217;ve managed to find the sweet spot of trade-offs to support both the <code>[Obsolete]<\/code> and <code>[EditorBrowsable]<\/code> attributes while also ensuring that the IDE performance remains unaffected. Types and members marked as obsolete are now de-prioritized in the completion list sorting. This should be particularly useful for Unity developers, where some common base classes have many obsolete members. Types and members marked with <code>EditorBrowsableState.Never<\/code> are filtered out from the list by default:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized is-style-default aligncenter\">\n    <img\n        src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/filtering-and-sorting-in-code-completion-lists.png\"\n        alt=\"Filtering and sorting in code completion lists\"\n        width=\"660\"\/>\n   <figcaption class=\"wp-element-caption\">Filtering and sorting in code completion lists<\/figcaption>\n<\/figure>\n\n\n\n<p>You can change the filter behavior for the <code>[EditorBrowsable]<\/code> attribute in the code completion settings:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized is-style-default aligncenter\">\n    <img\n        src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/code-completion-settings-for-the-editorbrowsable-attribute.png\"\n        alt=\"Code completion settings for the [EditorBrowsable] attribute\"\n        width=\"660\"\/>\n   <figcaption class=\"wp-element-caption\">Code completion settings for the [EditorBrowsable] attribute<\/figcaption>\n<\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Operation Priority Quick-Fixes<\/h2>\n\n\n\n<p>In C#, certain operations, such as enum flag checks or nested ternary conditional expressions, may require extra parentheses to ensure correct priority and readability. Adding these parentheses manually can be cumbersome and disrupt your coding flow. To streamline this, we&#8217;ve introduced a <em>Prioritize operation using parentheses<\/em> quick-fix that automatically inserts any necessary parentheses in these common scenarios, allowing you to focus on more critical aspects of your code:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized is-style-default aligncenter\">\n    <img\n        src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/prioritizing-operations-using-parentheses.jpg\"\n        data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/prioritizing-operations-using-parentheses.gif\"\n        alt=\"Prioritizing operations using parentheses\"\n        width=\"660\"\/>\n    <figcaption class=\"wp-element-caption\">Prioritizing operations using parentheses<\/figcaption>\n<\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>.NET 9 and C# 13 bring powerful advancements in runtime and language. ReSharper and Rider are here to complement them with the best-in-class and most productive IDE experience!<\/p>\n\n\n\n<p>As always\u2014make sure to use the comment section below to let us know about other features around .NET and C# you&#8217;d like to see in your developer toolbox!<\/p>\n","protected":false},"author":553,"featured_media":525174,"comment_status":"closed","ping_status":"closed","template":"","categories":[4992,1401],"tags":[158,8553,211,8538,46,1978,1941],"cross-post-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/dotnet\/525492"}],"collection":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/dotnet"}],"about":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/types\/dotnet"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/users\/553"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/comments?post=525492"}],"version-history":[{"count":9,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/dotnet\/525492\/revisions"}],"predecessor-version":[{"id":557401,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/dotnet\/525492\/revisions\/557401"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media\/525174"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media?parent=525492"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/categories?post=525492"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/tags?post=525492"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/cross-post-tag?post=525492"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}