From 4889ef7ee14cf55f516fe9c179a1869ecf435ad2 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 12 Sep 2024 10:14:15 -0700 Subject: [PATCH 1/2] Log messages for Test Results --- .../LanguageServerResources.resx | 12 ++++ .../Testing/TestRunner.TestRunHandler.cs | 65 +++++++++++++++++-- .../xlf/LanguageServerResources.cs.xlf | 20 ++++++ .../xlf/LanguageServerResources.de.xlf | 20 ++++++ .../xlf/LanguageServerResources.es.xlf | 20 ++++++ .../xlf/LanguageServerResources.fr.xlf | 20 ++++++ .../xlf/LanguageServerResources.it.xlf | 20 ++++++ .../xlf/LanguageServerResources.ja.xlf | 20 ++++++ .../xlf/LanguageServerResources.ko.xlf | 20 ++++++ .../xlf/LanguageServerResources.pl.xlf | 20 ++++++ .../xlf/LanguageServerResources.pt-BR.xlf | 20 ++++++ .../xlf/LanguageServerResources.ru.xlf | 20 ++++++ .../xlf/LanguageServerResources.tr.xlf | 20 ++++++ .../xlf/LanguageServerResources.zh-Hans.xlf | 20 ++++++ .../xlf/LanguageServerResources.zh-Hant.xlf | 20 ++++++ 15 files changed, 332 insertions(+), 5 deletions(-) diff --git a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/LanguageServerResources.resx b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/LanguageServerResources.resx index 890a0f135613b..404ee9daf58d7 100644 --- a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/LanguageServerResources.resx +++ b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/LanguageServerResources.resx @@ -240,4 +240,16 @@ Project {0} has unresolved dependencies + + Standard Output Messages + + + Standard Error Messages + + + Debug Trace Messages + + + Additional Info Messages + \ No newline at end of file diff --git a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Testing/TestRunner.TestRunHandler.cs b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Testing/TestRunner.TestRunHandler.cs index 53344dbc24313..7753a3121fdf8 100644 --- a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Testing/TestRunner.TestRunHandler.cs +++ b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Testing/TestRunner.TestRunHandler.cs @@ -2,9 +2,12 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System.Collections.Immutable; +using System.Collections.ObjectModel; using System.Text; using Microsoft.CodeAnalysis.LanguageServer.Handler; using Microsoft.CodeAnalysis.LanguageServer.Handler.Testing; +using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.Extensions.Logging; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client; @@ -138,23 +141,53 @@ private static string CreateTestCaseReportMessage(TestRunChangedEventArgs? testR { var messageBuilder = new StringBuilder(); messageBuilder.Append($"[{result.Outcome}] {result.TestCase.DisplayName}"); - if (result.ErrorMessage != null || result.ErrorStackTrace != null) - { - messageBuilder.AppendLine(); - } if (!string.IsNullOrWhiteSpace(result.ErrorMessage)) { + messageBuilder.AppendLine(); messageBuilder.AppendLine(IndentString($"{LanguageServerResources.Message}:", 4)); messageBuilder.AppendLine(IndentString(result.ErrorMessage, 8)); } if (!string.IsNullOrWhiteSpace(result.ErrorStackTrace)) { + messageBuilder.AppendLine(); messageBuilder.AppendLine(value: IndentString($"{LanguageServerResources.Stack_Trace}:", 4)); messageBuilder.AppendLine(IndentString(result.ErrorStackTrace, 8)); } + var standardOutputMessages = GetTestMessages(result.Messages, TestResultMessage.StandardOutCategory); + if (standardOutputMessages.Length > 0) + { + messageBuilder.AppendLine(); + messageBuilder.AppendLine(value: IndentString($"{LanguageServerResources.Standard_Output_Messages}:", 4)); + messageBuilder.AppendLine(FormatMessages(standardOutputMessages, 8)); + } + + var standardErrorMessages = GetTestMessages(result.Messages, TestResultMessage.StandardErrorCategory); + if (standardErrorMessages.Length > 0) + { + messageBuilder.AppendLine(); + messageBuilder.AppendLine(value: IndentString($"{LanguageServerResources.Standard_Error_Messages}:", 4)); + messageBuilder.AppendLine(FormatMessages(standardErrorMessages, 8)); + } + + var debugTraceMessages = GetTestMessages(result.Messages, TestResultMessage.DebugTraceCategory); + if (debugTraceMessages.Length > 0) + { + messageBuilder.AppendLine(); + messageBuilder.AppendLine(value: IndentString($"{LanguageServerResources.Debug_Trace_Messages}:", 4)); + messageBuilder.AppendLine(FormatMessages(debugTraceMessages, 8)); + } + + var additionalInfoMessages = GetTestMessages(result.Messages, TestResultMessage.AdditionalInfoCategory); + if (additionalInfoMessages.Length > 0) + { + messageBuilder.AppendLine(); + messageBuilder.AppendLine(value: IndentString($"{LanguageServerResources.Additional_Info_Messages}:", 4)); + messageBuilder.AppendLine(FormatMessages(additionalInfoMessages, 8)); + } + return messageBuilder.ToString(); }); @@ -162,7 +195,29 @@ private static string CreateTestCaseReportMessage(TestRunChangedEventArgs? testR static string IndentString(string text, int count) { - return text.Replace(Environment.NewLine, $"{Environment.NewLine} ").TrimEnd().Insert(0, new string(' ', count)); + var indentation = new string(' ', count); + return text.Replace(Environment.NewLine, $"{Environment.NewLine}{indentation}").TrimEnd().Insert(0, indentation); + } + + static ImmutableArray GetTestMessages(Collection messages, string requiredCategory) + { + return messages.WhereAsArray(static (msg, category) => msg.Category.Equals(category, StringComparison.OrdinalIgnoreCase), requiredCategory); + } + + static string FormatMessages(ImmutableArray messages, int indentation) + { + var builder = new StringBuilder(); + foreach (var message in messages) + { + if (message.Text is null) + continue; + + var indentedMessage = IndentString(message.Text, indentation); + if (!string.IsNullOrWhiteSpace(indentedMessage)) + builder.Append(indentedMessage); + } + + return builder.ToString(); } } } diff --git a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.cs.xlf b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.cs.xlf index ca6673bf876c9..3f692c5accc7a 100644 --- a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.cs.xlf +++ b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.cs.xlf @@ -7,6 +7,11 @@ Přerušeno! + + Additional Info Messages + Additional Info Messages + + Attaching debugger to process {0} Připojování ladicího programu k procesu {0} @@ -32,6 +37,11 @@ Dokončilo se (opětovné) načtení všech projektů v čase {0} The placeholder is a time duration like 00:15 + + Debug Trace Messages + Debug Trace Messages + + Debugging tests... Ladí se testy… @@ -162,6 +172,16 @@ Trasování zásobníku + + Standard Error Messages + Standard Error Messages + + + + Standard Output Messages + Standard Output Messages + + Starting test discovery Spouštění zjišťování testů… diff --git a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.de.xlf b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.de.xlf index 57f3c43bdc6a3..886437ae4d6df 100644 --- a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.de.xlf +++ b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.de.xlf @@ -7,6 +7,11 @@ Abgebrochen! + + Additional Info Messages + Additional Info Messages + + Attaching debugger to process {0} Debugger wird an Prozess "{0}" angefügt @@ -32,6 +37,11 @@ Abgeschlossenes (erneutes) Laden aller Projekte in {0} The placeholder is a time duration like 00:15 + + Debug Trace Messages + Debug Trace Messages + + Debugging tests... Debugging von Tests wird ausgeführt... @@ -162,6 +172,16 @@ Stapelüberwachung + + Standard Error Messages + Standard Error Messages + + + + Standard Output Messages + Standard Output Messages + + Starting test discovery Testermittlung wird gestartet diff --git a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.es.xlf b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.es.xlf index ffbbb2b8bca28..04fa3a8aeb227 100644 --- a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.es.xlf +++ b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.es.xlf @@ -7,6 +7,11 @@ ¡Anulado! + + Additional Info Messages + Additional Info Messages + + Attaching debugger to process {0} Asociación del depurador para procesar {0} @@ -32,6 +37,11 @@ (Re)carga completa de todos los proyectos en {0} The placeholder is a time duration like 00:15 + + Debug Trace Messages + Debug Trace Messages + + Debugging tests... Depurando pruebas... @@ -162,6 +172,16 @@ Seguimiento de la pila + + Standard Error Messages + Standard Error Messages + + + + Standard Output Messages + Standard Output Messages + + Starting test discovery Iniciando detección de pruebas diff --git a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.fr.xlf b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.fr.xlf index 6941c95ef6fb4..a3a6efc871d65 100644 --- a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.fr.xlf +++ b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.fr.xlf @@ -7,6 +7,11 @@ Abandonné ! + + Additional Info Messages + Additional Info Messages + + Attaching debugger to process {0} Attachement du débogueur au processus {0} @@ -32,6 +37,11 @@ Chargement ou rechargement terminé de tous les projets dans {0} The placeholder is a time duration like 00:15 + + Debug Trace Messages + Debug Trace Messages + + Debugging tests... Débogage en cours des tests... @@ -162,6 +172,16 @@ Trace de la pile + + Standard Error Messages + Standard Error Messages + + + + Standard Output Messages + Standard Output Messages + + Starting test discovery Démarrage de la découverte de tests diff --git a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.it.xlf b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.it.xlf index 27e970862bbae..bc6c2f5fad0a4 100644 --- a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.it.xlf +++ b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.it.xlf @@ -7,6 +7,11 @@ Interrotto! + + Additional Info Messages + Additional Info Messages + + Attaching debugger to process {0} Collegamento del debugger all'elaborazione di {0} @@ -32,6 +37,11 @@ Completato il (ri)caricamento di tutti i progetti in {0} The placeholder is a time duration like 00:15 + + Debug Trace Messages + Debug Trace Messages + + Debugging tests... Debug dei test... @@ -162,6 +172,16 @@ Analisi dello stack + + Standard Error Messages + Standard Error Messages + + + + Standard Output Messages + Standard Output Messages + + Starting test discovery Avvio dell'individuazione dei test diff --git a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ja.xlf b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ja.xlf index c4940eb7c664d..8bfd7778dd809 100644 --- a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ja.xlf +++ b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ja.xlf @@ -7,6 +7,11 @@ 中止されました! + + Additional Info Messages + Additional Info Messages + + Attaching debugger to process {0} プロセス {0} にデバッガーをアタッチしています @@ -32,6 +37,11 @@ {0} のすべてのプロジェクトの (再) 読み込みが完了しました The placeholder is a time duration like 00:15 + + Debug Trace Messages + Debug Trace Messages + + Debugging tests... テストをデバッグしています... @@ -162,6 +172,16 @@ スタック トレース + + Standard Error Messages + Standard Error Messages + + + + Standard Output Messages + Standard Output Messages + + Starting test discovery テストの検出を開始します diff --git a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ko.xlf b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ko.xlf index 56ecb0074946d..1ca432945e8f9 100644 --- a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ko.xlf +++ b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ko.xlf @@ -7,6 +7,11 @@ 중단됨! + + Additional Info Messages + Additional Info Messages + + Attaching debugger to process {0} 프로세스 {0}에 디버거를 연결하는 중 @@ -32,6 +37,11 @@ {0}에 있는 모든 프로젝트의 (재)로드가 완료됨 The placeholder is a time duration like 00:15 + + Debug Trace Messages + Debug Trace Messages + + Debugging tests... 테스트를 디버그하는 중... @@ -162,6 +172,16 @@ 스택 추적 + + Standard Error Messages + Standard Error Messages + + + + Standard Output Messages + Standard Output Messages + + Starting test discovery 테스트 검색을 시작하는 중 diff --git a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pl.xlf b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pl.xlf index 6bb6fb61ba444..658b055b599b2 100644 --- a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pl.xlf +++ b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pl.xlf @@ -7,6 +7,11 @@ Przerwane! + + Additional Info Messages + Additional Info Messages + + Attaching debugger to process {0} Dołączanie debugera do procesu {0} @@ -32,6 +37,11 @@ Ukończono (ponownie)ładowanie wszystkich projektów w usłudze {0} The placeholder is a time duration like 00:15 + + Debug Trace Messages + Debug Trace Messages + + Debugging tests... Trwa debugowanie testów... @@ -162,6 +172,16 @@ Śledzenie stosu + + Standard Error Messages + Standard Error Messages + + + + Standard Output Messages + Standard Output Messages + + Starting test discovery Uruchamianie odnajdywania testów diff --git a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pt-BR.xlf b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pt-BR.xlf index 0be751a2cb52d..2bc8e705be376 100644 --- a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pt-BR.xlf +++ b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pt-BR.xlf @@ -7,6 +7,11 @@ Anulado! + + Additional Info Messages + Additional Info Messages + + Attaching debugger to process {0} Anexar o depurador ao processo {0} @@ -32,6 +37,11 @@ (Re)carregamento concluído de todos os projetos em {0} The placeholder is a time duration like 00:15 + + Debug Trace Messages + Debug Trace Messages + + Debugging tests... Depurando testes... @@ -162,6 +172,16 @@ Rastreamento de pilha + + Standard Error Messages + Standard Error Messages + + + + Standard Output Messages + Standard Output Messages + + Starting test discovery Iniciando a detecção de testes diff --git a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ru.xlf b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ru.xlf index 9f6ffe157bbd1..59437ba4e25a2 100644 --- a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ru.xlf +++ b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ru.xlf @@ -7,6 +7,11 @@ Прервано + + Additional Info Messages + Additional Info Messages + + Attaching debugger to process {0} Подключение отладчика для обработки {0} @@ -32,6 +37,11 @@ Завершена (повторная) загрузка всех проектов в {0} The placeholder is a time duration like 00:15 + + Debug Trace Messages + Debug Trace Messages + + Debugging tests... Идет отладка тестов... @@ -162,6 +172,16 @@ Трассировка стека + + Standard Error Messages + Standard Error Messages + + + + Standard Output Messages + Standard Output Messages + + Starting test discovery Запуск обнаружения тестов diff --git a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.tr.xlf b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.tr.xlf index 095b6ce4197ac..a21f0b3303281 100644 --- a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.tr.xlf +++ b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.tr.xlf @@ -7,6 +7,11 @@ Durduruldu! + + Additional Info Messages + Additional Info Messages + + Attaching debugger to process {0} Hata ayıklayıcı, {0} işlemine ekleniyor @@ -32,6 +37,11 @@ Tüm projelerin (yeniden) yüklemesi {0} içinde tamamlandı The placeholder is a time duration like 00:15 + + Debug Trace Messages + Debug Trace Messages + + Debugging tests... Test hataları ayıklanıyor... @@ -162,6 +172,16 @@ Yığın İzleme + + Standard Error Messages + Standard Error Messages + + + + Standard Output Messages + Standard Output Messages + + Starting test discovery Test bulma başlatılıyor diff --git a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hans.xlf b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hans.xlf index 9c0e452b77054..80c31b1ade404 100644 --- a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hans.xlf +++ b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hans.xlf @@ -7,6 +7,11 @@ 已中止! + + Additional Info Messages + Additional Info Messages + + Attaching debugger to process {0} 正在将调试器附加到进程 {0} @@ -32,6 +37,11 @@ 已完成加载(重新加载) {0} 中的所有项目 The placeholder is a time duration like 00:15 + + Debug Trace Messages + Debug Trace Messages + + Debugging tests... 正在调试测试... @@ -162,6 +172,16 @@ 堆栈跟踪 + + Standard Error Messages + Standard Error Messages + + + + Standard Output Messages + Standard Output Messages + + Starting test discovery 正在启动测试发现 diff --git a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hant.xlf b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hant.xlf index b3ce5e2fdaaec..02bcf5a74d0f1 100644 --- a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hant.xlf +++ b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hant.xlf @@ -7,6 +7,11 @@ 已中止! + + Additional Info Messages + Additional Info Messages + + Attaching debugger to process {0} 正在將偵錯工具連結到處理序 {0} @@ -32,6 +37,11 @@ 已完成 {0} 中所有專案的(重新)載入 The placeholder is a time duration like 00:15 + + Debug Trace Messages + Debug Trace Messages + + Debugging tests... 正在偵錯測試... @@ -162,6 +172,16 @@ 堆疊追蹤 + + Standard Error Messages + Standard Error Messages + + + + Standard Output Messages + Standard Output Messages + + Starting test discovery 即將開始測試探索 From 1803abf50c38c7317392a9f1b4486283185d10bd Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 12 Sep 2024 10:53:38 -0700 Subject: [PATCH 2/2] Remove newlines between test run information sections --- .../Testing/TestRunner.TestRunHandler.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Testing/TestRunner.TestRunHandler.cs b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Testing/TestRunner.TestRunHandler.cs index 7753a3121fdf8..106f36090ad14 100644 --- a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Testing/TestRunner.TestRunHandler.cs +++ b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Testing/TestRunner.TestRunHandler.cs @@ -140,18 +140,16 @@ private static string CreateTestCaseReportMessage(TestRunChangedEventArgs? testR var results = testRunChangedEventArgs.NewTestResults.Select(result => { var messageBuilder = new StringBuilder(); - messageBuilder.Append($"[{result.Outcome}] {result.TestCase.DisplayName}"); + messageBuilder.AppendLine($"[{result.Outcome}] {result.TestCase.DisplayName}"); if (!string.IsNullOrWhiteSpace(result.ErrorMessage)) { - messageBuilder.AppendLine(); messageBuilder.AppendLine(IndentString($"{LanguageServerResources.Message}:", 4)); messageBuilder.AppendLine(IndentString(result.ErrorMessage, 8)); } if (!string.IsNullOrWhiteSpace(result.ErrorStackTrace)) { - messageBuilder.AppendLine(); messageBuilder.AppendLine(value: IndentString($"{LanguageServerResources.Stack_Trace}:", 4)); messageBuilder.AppendLine(IndentString(result.ErrorStackTrace, 8)); } @@ -159,7 +157,6 @@ private static string CreateTestCaseReportMessage(TestRunChangedEventArgs? testR var standardOutputMessages = GetTestMessages(result.Messages, TestResultMessage.StandardOutCategory); if (standardOutputMessages.Length > 0) { - messageBuilder.AppendLine(); messageBuilder.AppendLine(value: IndentString($"{LanguageServerResources.Standard_Output_Messages}:", 4)); messageBuilder.AppendLine(FormatMessages(standardOutputMessages, 8)); } @@ -167,7 +164,6 @@ private static string CreateTestCaseReportMessage(TestRunChangedEventArgs? testR var standardErrorMessages = GetTestMessages(result.Messages, TestResultMessage.StandardErrorCategory); if (standardErrorMessages.Length > 0) { - messageBuilder.AppendLine(); messageBuilder.AppendLine(value: IndentString($"{LanguageServerResources.Standard_Error_Messages}:", 4)); messageBuilder.AppendLine(FormatMessages(standardErrorMessages, 8)); } @@ -175,7 +171,6 @@ private static string CreateTestCaseReportMessage(TestRunChangedEventArgs? testR var debugTraceMessages = GetTestMessages(result.Messages, TestResultMessage.DebugTraceCategory); if (debugTraceMessages.Length > 0) { - messageBuilder.AppendLine(); messageBuilder.AppendLine(value: IndentString($"{LanguageServerResources.Debug_Trace_Messages}:", 4)); messageBuilder.AppendLine(FormatMessages(debugTraceMessages, 8)); } @@ -183,7 +178,6 @@ private static string CreateTestCaseReportMessage(TestRunChangedEventArgs? testR var additionalInfoMessages = GetTestMessages(result.Messages, TestResultMessage.AdditionalInfoCategory); if (additionalInfoMessages.Length > 0) { - messageBuilder.AppendLine(); messageBuilder.AppendLine(value: IndentString($"{LanguageServerResources.Additional_Info_Messages}:", 4)); messageBuilder.AppendLine(FormatMessages(additionalInfoMessages, 8)); } @@ -191,7 +185,7 @@ private static string CreateTestCaseReportMessage(TestRunChangedEventArgs? testR return messageBuilder.ToString(); }); - return string.Join(Environment.NewLine, results); + return string.Join("", results); static string IndentString(string text, int count) {