@@ -28,12 +28,6 @@ use tower::{Service, ServiceExt};
28
28
use tower_lsp:: jsonrpc;
29
29
use tower_lsp:: jsonrpc:: Response ;
30
30
use tower_lsp:: lsp_types as lsp;
31
- use tower_lsp:: lsp_types:: CodeActionClientCapabilities ;
32
- use tower_lsp:: lsp_types:: CodeActionKind ;
33
- use tower_lsp:: lsp_types:: CodeActionKindLiteralSupport ;
34
- use tower_lsp:: lsp_types:: CodeActionLiteralSupport ;
35
- use tower_lsp:: lsp_types:: CodeActionOptions ;
36
- use tower_lsp:: lsp_types:: CodeActionProviderCapability ;
37
31
use tower_lsp:: lsp_types:: DidOpenTextDocumentParams ;
38
32
use tower_lsp:: lsp_types:: DocumentFormattingParams ;
39
33
use tower_lsp:: lsp_types:: FormattingOptions ;
@@ -42,7 +36,6 @@ use tower_lsp::lsp_types::InitializedParams;
42
36
use tower_lsp:: lsp_types:: Position ;
43
37
use tower_lsp:: lsp_types:: PublishDiagnosticsParams ;
44
38
use tower_lsp:: lsp_types:: Range ;
45
- use tower_lsp:: lsp_types:: TextDocumentClientCapabilities ;
46
39
use tower_lsp:: lsp_types:: TextDocumentContentChangeEvent ;
47
40
use tower_lsp:: lsp_types:: TextDocumentIdentifier ;
48
41
use tower_lsp:: lsp_types:: TextDocumentItem ;
@@ -190,6 +183,7 @@ impl Server {
190
183
)
191
184
. await ?
192
185
. context ( "initialize returned None" ) ?;
186
+
193
187
Ok ( ( ) )
194
188
}
195
189
@@ -411,104 +405,6 @@ where
411
405
Ok ( ( ) )
412
406
}
413
407
414
- #[ allow( deprecated) ]
415
- #[ tokio:: test]
416
- async fn server_capabilities_fix_all_code_action_kinds ( ) -> Result < ( ) > {
417
- let factory = ServerFactory :: default ( ) ;
418
- let ( service, client) = factory. create ( None ) . into_inner ( ) ;
419
- let ( stream, sink) = client. split ( ) ;
420
- let mut server = Server :: new ( service) ;
421
-
422
- let ( sender, _) = channel ( CHANNEL_BUFFER_SIZE ) ;
423
- let reader = tokio:: spawn ( client_handler ( stream, sink, sender) ) ;
424
- let expect_code_action_provider =
425
- Some ( CodeActionProviderCapability :: Options ( CodeActionOptions {
426
- code_action_kinds : Some ( vec ! [ CodeActionKind :: new( "source.fixAll.biome" ) ] ) ,
427
- ..Default :: default ( )
428
- } ) ) ;
429
- let res: InitializeResult = server
430
- . request (
431
- "initialize" ,
432
- "_init" ,
433
- InitializeParams {
434
- process_id : None ,
435
- root_path : None ,
436
- root_uri : Some ( url ! ( "" ) ) ,
437
- initialization_options : None ,
438
- capabilities : ClientCapabilities {
439
- text_document : Some ( TextDocumentClientCapabilities {
440
- code_action : Some ( CodeActionClientCapabilities {
441
- code_action_literal_support : Some ( CodeActionLiteralSupport {
442
- code_action_kind : CodeActionKindLiteralSupport {
443
- value_set : Vec :: new ( ) ,
444
- } ,
445
- } ) ,
446
- ..CodeActionClientCapabilities :: default ( )
447
- } ) ,
448
-
449
- ..TextDocumentClientCapabilities :: default ( )
450
- } ) ,
451
-
452
- ..ClientCapabilities :: default ( )
453
- } ,
454
- trace : None ,
455
- workspace_folders : None ,
456
- client_info : None ,
457
- locale : None ,
458
- } ,
459
- )
460
- . await ?
461
- . context ( "initialize returned None" ) ?;
462
-
463
- assert_eq ! (
464
- res. capabilities. code_action_provider,
465
- expect_code_action_provider
466
- ) ;
467
- server. shutdown ( ) . await ?;
468
- reader. abort ( ) ;
469
-
470
- Ok ( ( ) )
471
- }
472
-
473
- #[ allow( deprecated) ]
474
- #[ tokio:: test]
475
- async fn server_capabilities_default_code_action_kinds ( ) -> Result < ( ) > {
476
- let factory = ServerFactory :: default ( ) ;
477
- let ( service, client) = factory. create ( None ) . into_inner ( ) ;
478
- let ( stream, sink) = client. split ( ) ;
479
- let mut server = Server :: new ( service) ;
480
-
481
- let ( sender, _) = channel ( CHANNEL_BUFFER_SIZE ) ;
482
- let reader = tokio:: spawn ( client_handler ( stream, sink, sender) ) ;
483
- let expect_code_action_provider = Some ( CodeActionProviderCapability :: Simple ( true ) ) ;
484
- let res: InitializeResult = server
485
- . request (
486
- "initialize" ,
487
- "_init" ,
488
- InitializeParams {
489
- process_id : None ,
490
- root_path : None ,
491
- root_uri : Some ( url ! ( "" ) ) ,
492
- initialization_options : None ,
493
- capabilities : ClientCapabilities :: default ( ) ,
494
- trace : None ,
495
- workspace_folders : None ,
496
- client_info : None ,
497
- locale : None ,
498
- } ,
499
- )
500
- . await ?
501
- . context ( "initialize returned None" ) ?;
502
- assert_eq ! (
503
- res. capabilities. code_action_provider,
504
- expect_code_action_provider
505
- ) ;
506
- server. shutdown ( ) . await ?;
507
- reader. abort ( ) ;
508
-
509
- Ok ( ( ) )
510
- }
511
-
512
408
#[ tokio:: test]
513
409
async fn basic_lifecycle ( ) -> Result < ( ) > {
514
410
let factory = ServerFactory :: default ( ) ;
0 commit comments