Skip to content

IDE0025 strangely indents when a comment follows the property name #38057

@stephentoub

Description

@stephentoub

Version Used:
3.3.0-beta3-19413-06+ac06df1bffb7b7fd0e5bf63cc91921af76b21e03

Steps to Reproduce:

using System;

class Program
{
    static void Main() => Console.WriteLine(Foo);

    private static string Foo // cool prop
    {
        get { return "blah"; }
    }
}

Run IDE0025.

Expected Behavior:

using System;

class Program
{
    static void Main() => Console.WriteLine(Foo);

    private static string Foo => // cool prop
        "blah";
}

or

using System;

class Program
{
    static void Main() => Console.WriteLine(Foo);

    private static string Foo =>
         // cool prop
        "blah";
}

or

using System;

class Program
{
    static void Main() => Console.WriteLine(Foo);

    // cool prop
    private static string Foo => "blah";
}

Actual Behavior:

using System;

class Program
{
    static void Main() => Console.WriteLine(Foo);

    private static string Foo // cool prop
=> "blah";
}

Metadata

Metadata

Assignees

Labels

Area-IDEBugFeature - IDE0025Use expression body for propertiesIDE-CodeStyleBuilt-in analyzers, fixes, and refactoringsIDE-FormatterCode formatter and/or smart indenthelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on it

Type

No type

Projects

Status

Completed

Relationships

None yet

Development

No branches or pull requests

Issue actions