Esempio n. 1
0
        void StartDebugAgent()
        {
            var startInfo = new ProcessStartInfo(Path.Combine(Path.GetDirectoryName(typeof(VSCodeDebuggerSession).Assembly.Location), "CoreClrAdaptor", "OpenDebugAD7"));

            startInfo.RedirectStandardOutput       = true;
            startInfo.RedirectStandardInput        = true;
            startInfo.StandardOutputEncoding       = Encoding.UTF8;
            startInfo.StandardOutputEncoding       = Encoding.UTF8;
            startInfo.UseShellExecute              = false;
            startInfo.EnvironmentVariables["PATH"] = "/usr/local/share/dotnet:" + Environment.GetEnvironmentVariable("PATH");
            debugAgentProcess       = Process.Start(startInfo);
            protocolClient          = new ProtocolClient();
            protocolClient.OnEvent += HandleAction;
            protocolClient.Start(debugAgentProcess.StandardOutput.BaseStream, debugAgentProcess.StandardInput.BaseStream)
            .ContinueWith((task) => {
                if (task.IsFaulted)
                {
                    Console.WriteLine(task.Exception);
                }
            });
            var initRequest = new InitializeRequest(new InitializeRequestArguments()
            {
                adapterID       = "coreclr",
                linesStartAt1   = true,
                columnsStartAt1 = true,
                pathFormat      = "path"
            });

            Capabilities = protocolClient.SendRequestAsync(initRequest).Result;
        }