Skip to content

Commit

Permalink
Merge pull request EvilBeaver#1454 from akpaevj/feature/tcp-dap
Browse files Browse the repository at this point in the history
Добавлена возможность запуска адаптера в режиме TCP сервера
  • Loading branch information
EvilBeaver authored Oct 1, 2024
2 parents 3ecfdca + b7f3d0d commit 5597092
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/VSCode.DebugAdapter/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This Source Code Form is subject to the terms of the
----------------------------------------------------------*/
using System;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using Serilog;
Expand All @@ -16,7 +17,17 @@ class Program
{
static void Main(string[] args)
{
StartSession(Console.OpenStandardInput(), Console.OpenStandardOutput());
if (args.Contains("--debug"))
{
var listener = TcpListener.Create(4711);
listener.Start();

using (var client = listener.AcceptTcpClient())
using (var stream = client.GetStream())
StartSession(stream, stream);
}
else
StartSession(Console.OpenStandardInput(), Console.OpenStandardOutput());
}

private static void StartSession(Stream input, Stream output)
Expand Down
8 changes: 8 additions & 0 deletions src/VSCode.DebugAdapter/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"profiles": {
"VSCode.DebugAdapter": {
"commandName": "Project",
"commandLineArgs": "--debug"
}
}
}

0 comments on commit 5597092

Please sign in to comment.