mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-15 06:42:25 +02:00
Toolshed (#4197)
* Saving work * Move shit to engine * lord * merg * awa * bql is kill * forgot the fucking bike rack * bql is kill for real * pjb will kill me * aughfhbdj * yo ho here we go on my way to the MINES * a * adgddf * gdsgvfvxshngfgh * b * hfsjhghj * hbfdjjh * tf you mean i have to document it * follow C# standards * Assorted cleanup and documentation pass, minor bugfix in ValueRefParser. * Start porting old commands, remove that pesky prefix in favor of integrating with the shell. * Fix valueref up a bit, improve autocomplete for it. * e * Toolshed type system adventure. * a log * a * a e i o u * awa * fix tests * Arithmetic commands. * a * parse improvements --------- Co-authored-by: moonheart08 <moonheart08@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using ILReader;
|
||||
using ILReader.Readers;
|
||||
using Robust.Shared.Toolshed;
|
||||
|
||||
namespace Robust.Shared.Scripting;
|
||||
|
||||
[ToolshedCommand]
|
||||
public sealed class ILCommand : ToolshedCommand
|
||||
{
|
||||
[CommandImplementation("dumpil")]
|
||||
public void DumpIL(
|
||||
[CommandInvocationContext] IInvocationContext ctx,
|
||||
[PipedArgument] MethodInfo info
|
||||
)
|
||||
{
|
||||
var reader = GetReader(info);
|
||||
|
||||
foreach (var instruction in reader)
|
||||
{
|
||||
if (instruction is null)
|
||||
break;
|
||||
|
||||
ctx.WriteLine(instruction.ToString()!);
|
||||
}
|
||||
}
|
||||
|
||||
private IILReader GetReader(MethodBase method)
|
||||
{
|
||||
IILReaderConfiguration cfg = ILReader.Configuration.Resolve(method);
|
||||
return cfg.GetReader(method);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user