Fixed indentation in shader source for local methods

このコミットが含まれているのは:
Sergio Pedri committed 2019-08-17 23:08:49 +02:00
1 親 ab9d5944dc
コミット f0acc27098
1ファイル変更
+3 -2
+3 -2
ファイルの表示
@@ -142,10 +142,11 @@ namespace ComputeSharp.Shaders.Translation
EntityHandle methodHandle = MetadataTokenHelpers.TryAsEntityHandle(methodInfo.MetadataToken) ?? throw new InvalidOperationException();
string
methodOnlySourceCode = decompiler.DecompileAsString(methodHandle),
methodOnlyFixedSourceCode = LambdaMethodDeclarationRegex.Replace(methodOnlySourceCode, "internal void Main");
methodOnlyFixedSourceCode = LambdaMethodDeclarationRegex.Replace(methodOnlySourceCode, "internal void Main"),
methodOnlyIndentedSourceCode = $" {methodOnlyFixedSourceCode.Replace(Environment.NewLine, $"{Environment.NewLine} ")}";
int lastClosedBracketsIndex = methodFixedCode.LastIndexOf('}');
methodFixedCode = methodFixedCode.Insert(lastClosedBracketsIndex, methodOnlyFixedSourceCode);
methodFixedCode = methodFixedCode.Insert(lastClosedBracketsIndex, methodOnlyIndentedSourceCode);
}
// Load the type syntax tree