@@ -319,29 +319,17 @@ impl TestingLS {
319
319
if !stderr. is_empty ( ) {
320
320
let message =
321
321
"Cannot run test command: \n " . to_string ( ) + & String :: from_utf8 ( stderr) . unwrap ( ) ;
322
- let placeholder_diagnostic = Diagnostic {
323
- range : Range {
324
- start : Position {
325
- line : 0 ,
326
- character : 0 ,
327
- } ,
328
- end : Position {
329
- line : 0 ,
330
- character : 0 ,
331
- } ,
332
- } ,
322
+ let message_type = MessageType :: ERROR ;
323
+ let params: ShowMessageParams = ShowMessageParams {
324
+ typ : message_type,
333
325
message,
334
- severity : Some ( DiagnosticSeverity :: WARNING ) ,
335
- code_description : None ,
336
- code : None ,
337
- source : None ,
338
- tags : None ,
339
- related_information : None ,
340
- data : None ,
341
326
} ;
342
- for path in paths {
343
- diagnostics. push ( ( path. to_string ( ) , vec ! [ placeholder_diagnostic. clone( ) ] ) ) ;
344
- }
327
+ send_stdout ( & json ! ( {
328
+ "jsonrpc" : "2.0" ,
329
+ "method" : "window/showMessage" ,
330
+ "params" : params,
331
+ } ) )
332
+ . unwrap ( ) ;
345
333
}
346
334
347
335
let adapter_result =
@@ -575,42 +563,6 @@ mod tests {
575
563
assert_eq ! ( files, vec![ test_file. to_str( ) . unwrap( ) ] ) ;
576
564
}
577
565
578
- #[ test]
579
- fn bubble_adapter_error ( ) {
580
- let adapter_conf: AdapterConfiguration = AdapterConfiguration {
581
- path : std:: env:: current_dir ( )
582
- . unwrap ( )
583
- . join ( "target/debug/testing-ls-adapter" )
584
- . to_str ( )
585
- . unwrap ( )
586
- . to_string ( ) ,
587
- extra_arg : vec ! [ "--invalid-arg" . to_string( ) ] ,
588
- ..Default :: default ( )
589
- } ;
590
- let abs_path_of_demo = std:: env:: current_dir ( ) . unwrap ( ) . join ( "demo/rust" ) ;
591
- let files =
592
- TestingLS :: project_files ( & abs_path_of_demo. clone ( ) , & [ "/**/*.rs" . to_string ( ) ] , & [ ] ) ;
593
-
594
- let server = TestingLS {
595
- workspace_folders : Some ( vec ! [ WorkspaceFolder {
596
- uri: Url :: from_file_path( & abs_path_of_demo) . unwrap( ) ,
597
- name: "demo" . to_string( ) ,
598
- } ] ) ,
599
- options : InitializedOptions {
600
- adapter_command : HashMap :: from ( [ ( String :: from ( ".rs" ) , adapter_conf. clone ( ) ) ] ) ,
601
- enable_workspace_diagnostics : Some ( true ) ,
602
- } ,
603
- workspaces_cache : Vec :: new ( ) ,
604
- } ;
605
- let diagnostics = server
606
- . get_diagnostics ( & adapter_conf, abs_path_of_demo. to_str ( ) . unwrap ( ) , & files)
607
- . unwrap ( ) ;
608
- assert_eq ! ( diagnostics. len( ) , 1 ) ;
609
- let diagnostic = diagnostics. first ( ) . unwrap ( ) . 1 . first ( ) . unwrap ( ) ;
610
- assert_eq ! ( diagnostic. severity. unwrap( ) , DiagnosticSeverity :: WARNING ) ;
611
- assert ! ( diagnostic. message. contains( "Cannot run test command:" ) ) ;
612
- }
613
-
614
566
#[ test]
615
567
fn skip_workspace_diagnostics ( ) {
616
568
let mut server = TestingLS {
0 commit comments