Skip to content

False positive for SA1013 with newlines inside interpolations #3898

Open
@jnm2

Description

@jnm2

C# 11+ allows newlines inside interpolations (https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#newlines-in-string-interpolations).

With the following code snippet, and version 1.2.0-beta.556:

_ = $"abc {"some long C# expression here, after which I want to indent"
    } def";

SA1013 is reported on }. It misidentifies this as a closing brace of a block statement. Its own definition should even be allowing this:

A closing brace should always be preceded by a single space, unless it is the first character on the line.

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