Retry source requests
All checks were successful
Build / Compute Version (push) Successful in 6s
Build / Build Nuget package (SharedCringe) (push) Successful in 1m4s
Build / Build Nuget package (NuGet) (push) Successful in 1m6s
Build / Build Nuget package (CringeBootstrap.Abstractions) (push) Successful in 1m10s
Build / Build Nuget package (CringePlugins) (push) Successful in 1m18s
Build / Build Launcher (push) Successful in 1m54s

Handle missing sources
Minor Optimizations
Move thread pool improvement to debug while we fix it
This commit is contained in:
2025-06-01 11:11:50 -04:00
parent 2f492d9ed1
commit b12f1cc2f1
11 changed files with 72 additions and 54 deletions

View File

@@ -1,18 +1,18 @@
using HarmonyLib;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis;
using VRage.Scripting;
using CringeLauncher.SyntaxRewriters;
using VRage.Scripting.Rewriters;
namespace CringeLauncher.Patches;
[HarmonyPatch(typeof(MyScriptCompiler), "InjectMod")]
[HarmonyPatch(typeof(ProtoTagRewriter), "Rewrite")]
internal static class ModRewriterPatch
{
public static void Prefix(ref CSharpCompilation compilation, ref SyntaxTree syntaxTree)
public static bool Prefix(CSharpCompilation compilation, SyntaxTree syntaxTree, ref SyntaxTree __result)
{
var fixedSyntaxTree = MissingUsingRewriter.Rewrite(compilation, syntaxTree);
compilation = compilation.ReplaceSyntaxTree(syntaxTree, fixedSyntaxTree);
syntaxTree = fixedSyntaxTree;
__result = MissingUsingRewriter.Rewrite(compilation, syntaxTree);
return false;
}
}