dotnet/roslyn

Indenting a raw string literal breaks it when a line starts with different whitespace than the IDE indents with

Open

#59,594 opened on Feb 16, 2022

View on GitHub
 (2 comments) (0 reactions) (1 assignee)C# (4,257 forks)batch import
Area-IDEBughelp wanted

Repository metrics

Stars
 (20,414 stars)
PR merge metrics
 (Avg merge 6d 17h) (256 merged PRs in 30d)

Description

Version Used: 17.2-p1

Starting text:

var x =
"""
normal line
	line starts with tab char
""";

image

Select this statement and indent it. The IDE leaves the tab char at the start of the line and inserts spaces after it:

    var x =
    """
    normal line
	    line starts with tab char
    """;

image

This is no longer valid syntax.

Contributor guide