Skip to content
This repository was archived by the owner on Jul 12, 2022. It is now read-only.

Do not trim spaces at the beginning in copyright header comment #285

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected override bool IsNewLine(SyntaxTrivia trivia)

protected override SyntaxTrivia CreateLineComment(string commentText)
{
return SyntaxFactory.Comment("// " + commentText);
return SyntaxFactory.Comment("//" + commentText);
}

protected override SyntaxTrivia CreateNewLine()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected override bool IsNewLine(SyntaxTrivia trivia)

protected override SyntaxTrivia CreateLineComment(string commentText)
{
return SyntaxFactory.CommentTrivia("' " + commentText);
return SyntaxFactory.CommentTrivia("'" + commentText);
}

protected override SyntaxTrivia CreateNewLine()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,15 @@ private static string GetCommentText(string line)
{
if (line.StartsWith("'"))
{
return line.Substring(1).TrimStart();
return line.Substring(1);
}

if (line.StartsWith("//"))
{
return line.Substring(2).TrimStart();
return line.Substring(2);
}

return line;
return " " + line;
}

public override bool SupportsLanguage(string languageName)
Expand Down