ctx/tools/roslyn-helper/src/RoslynHelper/Program.cs
Ricardo Carneiro e67234345b feat(roslyn-helper): C# subprocess helper with JSON-RPC over stdin/stdout
Implements Prompt 3. Newline-delimited JSON-RPC dispatcher (ping,
loadSolution, projectSummary) with pure XML/.sln parsing — no Roslyn
or MSBuild NuGet packages (irreconcilable .NET 10 SDK API mismatches).
XDocument parses .csproj for frameworks/packages/refs; regex parses
.sln project entries; filesystem walk counts .cs/.fs/.vb documents.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 18:12:21 -03:00

21 lines
629 B
C#

using RoslynHelper.JsonRpc;
using RoslynHelper.Workspace;
namespace RoslynHelper;
public static class Program
{
public static async Task<int> Main(string[] args)
{
// UTF-8 without BOM on both ends of the pipe.
Console.InputEncoding = new System.Text.UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Console.OutputEncoding = new System.Text.UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
using var workspace = new WorkspaceManager();
var dispatcher = new Dispatcher(workspace);
await dispatcher.RunAsync(Console.In, Console.Out);
return 0;
}
}