mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
C#: Ensure that always use the same newline symbol for stub generation.
This commit is contained in:
@@ -68,7 +68,7 @@ public static class StubGenerator
|
||||
var stubPath = FileUtils.NestPaths(logger, outputPath, path.Replace(".dll", ".cs"));
|
||||
stubPaths.Add(stubPath);
|
||||
using var fileStream = new FileStream(stubPath, FileMode.Create, FileAccess.Write);
|
||||
using var writer = new StreamWriter(fileStream, new UTF8Encoding(false));
|
||||
using var writer = new StreamWriter(fileStream, new UTF8Encoding(false)) { NewLine = "\n" };
|
||||
|
||||
var visitor = new StubVisitor(writer, relevantSymbol);
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public int M1(string arg1) => throw null;
|
||||
var st = CSharpSyntaxTree.ParseText(source);
|
||||
var compilation = CSharpCompilation.Create(null, new[] { st });
|
||||
var sb = new StringBuilder();
|
||||
var visitor = new StubVisitor(new StringWriter(sb), new RelevantSymbolStub());
|
||||
var visitor = new StubVisitor(new StringWriter(sb) { NewLine = "\n" }, new RelevantSymbolStub());
|
||||
compilation.GlobalNamespace.Accept(visitor);
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user