11
11
using OmniSharp . Extensions . LanguageServer . Protocol . Models ;
12
12
using PowerShellEditorServices . Engine . Services . Handlers ;
13
13
using Xunit ;
14
+ using Xunit . Abstractions ;
14
15
using Range = OmniSharp . Extensions . LanguageServer . Protocol . Models . Range ;
15
16
16
17
namespace PowerShellEditorServices . Test . E2E
@@ -20,17 +21,32 @@ public class LanguageServerProtocolMessageTests : IClassFixture<TestsFixture>, I
20
21
private readonly static string s_binDir =
21
22
Path . GetDirectoryName ( Assembly . GetExecutingAssembly ( ) . Location ) ;
22
23
24
+ private static bool s_registeredOnLogMessage ;
25
+
23
26
private readonly LanguageClient LanguageClient ;
24
27
private readonly List < Diagnostic > Diagnostics ;
25
28
private readonly string PwshExe ;
29
+ private readonly ITestOutputHelper _output ;
26
30
27
- public LanguageServerProtocolMessageTests ( TestsFixture data )
31
+ public LanguageServerProtocolMessageTests ( ITestOutputHelper output , TestsFixture data )
28
32
{
29
33
Diagnostics = new List < Diagnostic > ( ) ;
30
34
LanguageClient = data . LanguageClient ;
31
35
Diagnostics = data . Diagnostics ;
32
36
PwshExe = TestsFixture . PwshExe ;
33
37
Diagnostics . Clear ( ) ;
38
+
39
+ _output = output ;
40
+
41
+ if ( ! s_registeredOnLogMessage )
42
+ {
43
+ LanguageClient . Window . OnLogMessage ( ( message , messageType ) =>
44
+ {
45
+ _output . WriteLine ( $ "{ messageType . ToString ( ) } : { message } ") ;
46
+ } ) ;
47
+
48
+ s_registeredOnLogMessage = true ;
49
+ }
34
50
}
35
51
36
52
public void Dispose ( )
0 commit comments