Skip to content

Commit 1165b30

Browse files
committed
Fix debug output breaking generated binding code.
1 parent e6c6346 commit 1165b30

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Generator/Generators/CodeGenerator.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,14 @@ public virtual void GenerateDeclarationCommon(Declaration decl)
9292
public virtual void GenerateDebug(Declaration decl)
9393
{
9494
if (Options.GenerateDebugOutput && !string.IsNullOrWhiteSpace(decl.DebugText))
95-
WriteLine("// DEBUG: " + decl.DebugText);
95+
{
96+
char[] newLineChars = {'\r', '\n'};
97+
var text = decl.DebugText;
98+
var index = text.IndexOfAny(newLineChars);
99+
if (index >= 0)
100+
text = text.Substring(0, index);
101+
WriteLine("// DEBUG: " + text);
102+
}
96103
}
97104

98105
#endregion

0 commit comments

Comments
 (0)