codecadwallader / codemaid

CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding.
http://www.codemaid.net
GNU Lesser General Public License v3.0
1.92k stars 363 forks source link

C#11 "required" keyword is being removed #1062

Open traseedarkwatch opened 4 days ago

traseedarkwatch commented 4 days ago

Environment

Description

The "required" keyword is being removed when code cleanup is done on the file.

Steps to recreate

Sample class. Run CodeMaid on this file.

public abstract Test
{
    public required string Name { get; set; }
}

Current behavior

The "required" keyword is being removed.

Expected behavior

The "required" keyword should remain. It is a valid C#11 keyword and used to enforce the initialization of properties and fields within a class, record, or struct.

SwissMaWi commented 3 days ago

Duplicate of https://github.com/codecadwallader/codemaid/issues/956 https://github.com/codecadwallader/codemaid/issues/956