All checks were successful
Build / Compute Version (push) Successful in 5s
Build / Build Nuget package (CringeBootstrap.Abstractions) (push) Successful in 49s
Build / Build Nuget package (SharedCringe) (push) Successful in 1m5s
Build / Build Nuget package (NuGet) (push) Successful in 1m6s
Build / Build Nuget package (CringePlugins) (push) Successful in 1m18s
Build / Build Launcher (push) Successful in 1m47s
Added Microsoft.VisualBasic to missing namespace patch
19 lines
591 B
C#
19 lines
591 B
C#
using HarmonyLib;
|
|
using Microsoft.CodeAnalysis.CSharp;
|
|
using Microsoft.CodeAnalysis;
|
|
using VRage.Scripting;
|
|
using CringeLauncher.SyntaxRewriters;
|
|
|
|
namespace CringeLauncher.Patches;
|
|
|
|
[HarmonyPatch(typeof(MyScriptCompiler), "InjectMod")]
|
|
internal static class ModRewriterPatch
|
|
{
|
|
public static void Prefix(ref CSharpCompilation compilation, ref SyntaxTree syntaxTree)
|
|
{
|
|
var fixedSyntaxTree = MissingUsingRewriter.Rewrite(compilation, syntaxTree);
|
|
compilation = compilation.ReplaceSyntaxTree(syntaxTree, fixedSyntaxTree);
|
|
syntaxTree = fixedSyntaxTree;
|
|
}
|
|
}
|