dotnet/roslyn

'Convert to raw string without leading whitespace' erroneously strips trailing whitespace

Open

#62 376 ouverte le 5 juil. 2022

Voir sur GitHub
 (7 commentaires) (0 réactions) (1 assigné)C# (4 257 forks)batch import
Area-IDEBughelp wanted

Métriques du dépôt

Stars
 (20 414 stars)
Métriques de merge PR
 (Merge moyen 6j 17h) (256 PRs mergées en 30 j)

Description

Version Used: 17.3.0-p2.0

This is not the semantics change described by the light bulb fix.

var whereClause = "Age >= 18";

var x = @"
    select FirstName, LastName
    from dbo.People
    where " + whereClause;

💡 "Convert to raw string without leading whitespace (may change semantics)":

var whereClause = "Age >= 18";

var x = """
    select FirstName, LastName
    from dbo.People
    where
    """ + whereClause;

The resulting string contains whereAge >= 18 instead of where Age >= 18.

Guide contributeur