Skip to content

Object initializers indent incorrectly when type initialized is generic #85

@josteink

Description

@josteink

The following indents fine:

var items = new ArrayList
{
    // items
};

The following does not:

var items = new List<string>
{
    // items
};

The reason for this is outlined in this issue here: #72 (comment)

The culprit for the code that's failing to indent properly in the test file seems to be https://github.com/josteink/csharp-mode/blob/master/csharp-mode.el#L485, which fails to recognize the presence of a vsemi when the object being initialized is a generic. This is a complicated issue to resolve because we would have to somehow recursively match the generic type parameter, which could itself be a generic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions