From a0950980970835e08d30c716db5156706c05cf31 Mon Sep 17 00:00:00 2001 From: Thad House Date: Fri, 23 Feb 2024 18:54:52 -0800 Subject: [PATCH] Remove thirdparty folder --- WPILib.sln | 6 +----- .../CodeHelpers.Test/CodeHelpers.Test.csproj | 2 +- .../Analyzer/LogGeneratorAnalyzer.cs | 2 +- .../LogGenerator/LoggableMember.cs | 20 ++++++++++++++++--- .../CodeHelpers/WPILib.CodeHelpers.csproj | 4 ++-- dev/Directory.Build.props | 2 +- dev/vbTest/Program.vb | 15 ++++++++++++++ .../Stereologue/Attributes.cs | 0 src/{thirdparty => }/Stereologue/ILogged.cs | 0 src/{thirdparty => }/Stereologue/LogLevel.cs | 0 src/{thirdparty => }/Stereologue/LogType.cs | 0 .../Stereologue/Stereologue.csproj | 4 ++-- .../Stereologue/Stereologuer.cs | 0 test/stereologue.test/stereologue.test.csproj | 2 +- 14 files changed, 41 insertions(+), 16 deletions(-) rename src/{thirdparty => }/Stereologue/Attributes.cs (100%) rename src/{thirdparty => }/Stereologue/ILogged.cs (100%) rename src/{thirdparty => }/Stereologue/LogLevel.cs (100%) rename src/{thirdparty => }/Stereologue/LogType.cs (100%) rename src/{thirdparty => }/Stereologue/Stereologue.csproj (74%) rename src/{thirdparty => }/Stereologue/Stereologuer.cs (100%) diff --git a/WPILib.sln b/WPILib.sln index cb94979f..42c28653 100644 --- a/WPILib.sln +++ b/WPILib.sln @@ -31,9 +31,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wpiutil.test", "test\wpiuti EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wpilibsharp", "src\wpilibsharp\wpilibsharp.csproj", "{AA0BE2D8-DCE2-415C-A60B-4382F50D8C91}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "thirdparty", "thirdparty", "{822627EF-820D-488B-BC14-BDC4BA88454B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stereologue", "src\thirdparty\Stereologue\Stereologue.csproj", "{2124D403-17C4-4116-932D-74933812ECE6}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stereologue", "src\Stereologue\Stereologue.csproj", "{2124D403-17C4-4116-932D-74933812ECE6}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "stereologue.test", "test\stereologue.test\stereologue.test.csproj", "{630D08FD-CD06-4674-BC5A-F1F211619E83}" EndProject @@ -137,8 +135,6 @@ Global {FA3D5F6A-561C-4F12-AE91-B10AE11F7BB8} = {AD95ECD8-E708-4FB4-9B7E-A8A8EF3FCB3E} {4EF1913A-C495-491D-9783-D758E4723170} = {AD95ECD8-E708-4FB4-9B7E-A8A8EF3FCB3E} {AA0BE2D8-DCE2-415C-A60B-4382F50D8C91} = {DB664556-4BF0-4874-8CB6-DC24E60A67AF} - {822627EF-820D-488B-BC14-BDC4BA88454B} = {DB664556-4BF0-4874-8CB6-DC24E60A67AF} - {2124D403-17C4-4116-932D-74933812ECE6} = {822627EF-820D-488B-BC14-BDC4BA88454B} {630D08FD-CD06-4674-BC5A-F1F211619E83} = {AD95ECD8-E708-4FB4-9B7E-A8A8EF3FCB3E} {76F4D0AE-2123-493B-B721-4118330C52BB} = {909FC1DB-3083-4F01-8496-B8C9DD4FEA13} {42E0EFC6-4990-4395-A9D1-8683778751E7} = {909FC1DB-3083-4F01-8496-B8C9DD4FEA13} diff --git a/codehelp/CodeHelpers.Test/CodeHelpers.Test.csproj b/codehelp/CodeHelpers.Test/CodeHelpers.Test.csproj index 2721c112..66f4887d 100644 --- a/codehelp/CodeHelpers.Test/CodeHelpers.Test.csproj +++ b/codehelp/CodeHelpers.Test/CodeHelpers.Test.csproj @@ -18,7 +18,7 @@ - + diff --git a/codehelp/CodeHelpers/LogGenerator/Analyzer/LogGeneratorAnalyzer.cs b/codehelp/CodeHelpers/LogGenerator/Analyzer/LogGeneratorAnalyzer.cs index a6072fbe..aa936026 100644 --- a/codehelp/CodeHelpers/LogGenerator/Analyzer/LogGeneratorAnalyzer.cs +++ b/codehelp/CodeHelpers/LogGenerator/Analyzer/LogGeneratorAnalyzer.cs @@ -4,7 +4,7 @@ namespace WPILib.CodeHelpers.LogGenerator.Analyzer; -[DiagnosticAnalyzer(LanguageNames.CSharp)] +[DiagnosticAnalyzer(LanguageNames.CSharp, [LanguageNames.VisualBasic])] public sealed class LogGeneratorAnalyzer : DiagnosticAnalyzer { public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create([ diff --git a/codehelp/CodeHelpers/LogGenerator/LoggableMember.cs b/codehelp/CodeHelpers/LogGenerator/LoggableMember.cs index e7e44173..91a4ce0c 100644 --- a/codehelp/CodeHelpers/LogGenerator/LoggableMember.cs +++ b/codehelp/CodeHelpers/LogGenerator/LoggableMember.cs @@ -67,19 +67,28 @@ public FailureMode WriteLogCall(IndentedStringBuilder? builder) { nullCheck = "?"; } - builder.AppendFullLine($"{getOperation}{nullCheck}.{Strings.UpdateStereologueName}($\"{{path}}/{path}\", logger);"); + string semi = builder.Language == LanguageKind.VisualBasic ? "" : ";"; + builder.AppendFullLine($"{getOperation}{nullCheck}.{Strings.UpdateStereologueName}($\"{{path}}/{path}\", logger){semi}"); } else { // We're an array, loop - builder.AppendFullLine($"foreach (var __tmpValue in {getOperation})"); + if (builder.Language == LanguageKind.CSharp) + { + builder.AppendFullLine($"foreach (var __tmpValue in {getOperation})"); + } + else if (builder.Language == LanguageKind.VisualBasic) + { + builder.AppendFullLine($"For Each __tmpValue in {getOperation}"); + } builder.EnterScope(ScopeType.ForEach); string nullCheck = ""; if (MemberDeclaration.LoggedKind != DeclarationKind.None) { nullCheck = "?"; } - builder.AppendFullLine($"__tmpValue{nullCheck}.{Strings.UpdateStereologueName}($\"{{path}}/{path}\", logger);"); + string semi = builder.Language == LanguageKind.VisualBasic ? "" : ";"; + builder.AppendFullLine($"__tmpValue{nullCheck}.{Strings.UpdateStereologueName}($\"{{path}}/{path}\", logger){semi}"); builder.ExitScope(); } return FailureMode.None; @@ -203,6 +212,11 @@ public FailureMode WriteLogCall(IndentedStringBuilder? builder) builder.ExitScope(); // If builder.ExitScope(); // Empty } + else if (MemberDeclaration.LoggedKind == DeclarationKind.ReadOnlyMemory || MemberDeclaration.LoggedKind == DeclarationKind.Memory) + { + string semi = builder.Language == LanguageKind.VisualBasic ? "" : ";"; + builder.AppendFullLine($"logger.{logMethod}($\"{{path}}/{path}\", {AttributeInfo.GetLogTypeString(builder.Language)}, {getOperation}.Span, {AttributeInfo.GetLogLevelString(builder.Language)}){semi}"); + } else { string semi = builder.Language == LanguageKind.VisualBasic ? "" : ";"; diff --git a/codehelp/CodeHelpers/WPILib.CodeHelpers.csproj b/codehelp/CodeHelpers/WPILib.CodeHelpers.csproj index 06def2c4..4cb3c5ed 100644 --- a/codehelp/CodeHelpers/WPILib.CodeHelpers.csproj +++ b/codehelp/CodeHelpers/WPILib.CodeHelpers.csproj @@ -15,8 +15,8 @@ - - + + diff --git a/dev/Directory.Build.props b/dev/Directory.Build.props index bfc0fffc..e78f894d 100644 --- a/dev/Directory.Build.props +++ b/dev/Directory.Build.props @@ -12,7 +12,7 @@ - + diff --git a/dev/vbTest/Program.vb b/dev/vbTest/Program.vb index 4e826bbc..af51c8cc 100644 --- a/dev/vbTest/Program.vb +++ b/dev/vbTest/Program.vb @@ -1,5 +1,6 @@ Imports System Imports Stereologue +Imports WPIMath.Geometry Module Program Sub Main(args As String()) @@ -8,8 +9,22 @@ Module Program End Module Namespace vbTest + Partial Public Class ExtraLogged + End Class + Partial Public Class LoggedClass Dim x As String Dim y As Integer + Dim z As ReadOnlyMemory(Of Long) + + Dim rot As Rotation2d + Dim rotArray As Rotation2d() + + Dim cls As ExtraLogged + Dim classArray As ExtraLogged() + + Function GetMemory() As ReadOnlyMemory(Of Long) + Return z + End Function End Class End Namespace diff --git a/src/thirdparty/Stereologue/Attributes.cs b/src/Stereologue/Attributes.cs similarity index 100% rename from src/thirdparty/Stereologue/Attributes.cs rename to src/Stereologue/Attributes.cs diff --git a/src/thirdparty/Stereologue/ILogged.cs b/src/Stereologue/ILogged.cs similarity index 100% rename from src/thirdparty/Stereologue/ILogged.cs rename to src/Stereologue/ILogged.cs diff --git a/src/thirdparty/Stereologue/LogLevel.cs b/src/Stereologue/LogLevel.cs similarity index 100% rename from src/thirdparty/Stereologue/LogLevel.cs rename to src/Stereologue/LogLevel.cs diff --git a/src/thirdparty/Stereologue/LogType.cs b/src/Stereologue/LogType.cs similarity index 100% rename from src/thirdparty/Stereologue/LogType.cs rename to src/Stereologue/LogType.cs diff --git a/src/thirdparty/Stereologue/Stereologue.csproj b/src/Stereologue/Stereologue.csproj similarity index 74% rename from src/thirdparty/Stereologue/Stereologue.csproj rename to src/Stereologue/Stereologue.csproj index 9721eaa6..9d33d47b 100644 --- a/src/thirdparty/Stereologue/Stereologue.csproj +++ b/src/Stereologue/Stereologue.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/src/thirdparty/Stereologue/Stereologuer.cs b/src/Stereologue/Stereologuer.cs similarity index 100% rename from src/thirdparty/Stereologue/Stereologuer.cs rename to src/Stereologue/Stereologuer.cs diff --git a/test/stereologue.test/stereologue.test.csproj b/test/stereologue.test/stereologue.test.csproj index 55864a83..3eb19b96 100644 --- a/test/stereologue.test/stereologue.test.csproj +++ b/test/stereologue.test/stereologue.test.csproj @@ -1,7 +1,7 @@ - +