Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Добавлена возможность запуска адаптера в режиме TCP сервера #1454

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 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,18 @@ 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"
}
}
}
2 changes: 1 addition & 1 deletion src/VSCode.DebugAdapter/VSCode.DebugAdapter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Configurations>Debug;Release;LinuxDebug</Configurations>
<AssemblyTitle>VSC debug adapter for 1Script</AssemblyTitle>
<Platforms>AnyCPU</Platforms>
<LangVersion>7.3</LangVersion>
<LangVersion>11.0</LangVersion>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Build Environment Missing .NET SDK

The build process failed because the dotnet command is not available in the environment. Additionally, the codebase is utilizing C# 11.0 features, which require the updated language version.

  • Ensure the build environment has the appropriate .NET SDK installed to support C# 11.0.
  • Verify that all dependencies are compatible with C# 11.0.
🔗 Analysis chain

Significant update to C# language version

The language version has been updated from 7.3 to 11.0, which is a substantial change. While this update allows for the use of newer C# features, it also has several implications:

  1. Ensure all developers have IDEs that support C# 11.0.
  2. Verify that the build environment and CI/CD pipelines are compatible with C# 11.0.
  3. Check for any potential compatibility issues with existing dependencies or .NET Framework versions.
  4. Consider documenting any new C# 11.0 features that will be utilized in the codebase.

To ensure compatibility and proper setup, please run the following verification script:

This script will help verify the .NET SDK version, ensure the project builds successfully with the new language version, and check for any usage of C# 11.0 specific features in the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify C# version compatibility and setup

# Test: Check .NET SDK version
dotnet --version

# Test: Verify successful build with new language version
dotnet build src/VSCode.DebugAdapter/VSCode.DebugAdapter.csproj

# Test: Check for any C# 11.0 specific features in the codebase
rg --type csharp "required|record struct|file scoped namespace|raw string literal|utf8 string literal|pattern matching|list patterns" src/

Length of output: 688

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а перехода на более старший рантайм не потребует?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Надо проверить

<Version>1.7.0.0</Version>
<FileVersion>1.7.0.0</FileVersion>
<GenerateRuntimeConfigDevFile>true</GenerateRuntimeConfigDevFile>
Expand Down