@@ -82,6 +82,10 @@ pub trait ILanguageClient {
82
82
fn rust_handleDiagnosticsBegin ( & self , params : & Option < Params > ) -> Result < ( ) > ;
83
83
fn rust_handleDiagnosticsEnd ( & self , params : & Option < Params > ) -> Result < ( ) > ;
84
84
fn cquery_handleProgress ( & self , params : & Option < Params > ) -> Result < ( ) > ;
85
+ fn cquery_base ( & self , params : & Option < Params > ) -> Result < Value > ;
86
+ fn cquery_derived ( & self , params : & Option < Params > ) -> Result < Value > ;
87
+ fn cquery_callers ( & self , params : & Option < Params > ) -> Result < Value > ;
88
+ fn cquery_vars ( & self , params : & Option < Params > ) -> Result < Value > ;
85
89
}
86
90
87
91
impl ILanguageClient for Arc < Mutex < State > > {
@@ -2446,6 +2450,170 @@ impl ILanguageClient for Arc<Mutex<State>> {
2446
2450
Ok ( ( ) )
2447
2451
}
2448
2452
2453
+ fn cquery_base ( & self , params : & Option < Params > ) -> Result < Value > {
2454
+ info ! ( "Begin {}" , REQUEST__CqueryBase ) ;
2455
+
2456
+ let ( buftype, languageId, filename, line, character, handle) : ( String , String , String , u64 , u64 , bool ) =
2457
+ self . gather_args (
2458
+ & [
2459
+ VimVar :: Buftype ,
2460
+ VimVar :: LanguageId ,
2461
+ VimVar :: Filename ,
2462
+ VimVar :: Line ,
2463
+ VimVar :: Character ,
2464
+ VimVar :: Handle ,
2465
+ ] ,
2466
+ params,
2467
+ ) ?;
2468
+ if !buftype. is_empty ( ) || languageId. is_empty ( ) {
2469
+ return Ok ( Value :: Null ) ;
2470
+ }
2471
+
2472
+ let result = self . call (
2473
+ Some ( & languageId) ,
2474
+ REQUEST__CqueryBase ,
2475
+ TextDocumentPositionParams {
2476
+ text_document : TextDocumentIdentifier {
2477
+ uri : filename. to_url ( ) ?,
2478
+ } ,
2479
+ position : Position { line, character } ,
2480
+ } ,
2481
+ ) ?;
2482
+
2483
+ if !handle {
2484
+ return Ok ( result) ;
2485
+ }
2486
+
2487
+ let locations: Vec < Location > = serde_json:: from_value ( result. clone ( ) ) ?;
2488
+ self . display_locations ( & locations, & languageId) ?;
2489
+
2490
+ info ! ( "End {}" , REQUEST__CqueryBase ) ;
2491
+ Ok ( result)
2492
+ }
2493
+
2494
+ fn cquery_derived ( & self , params : & Option < Params > ) -> Result < Value > {
2495
+ info ! ( "Begin {}" , REQUEST__CqueryDerived ) ;
2496
+
2497
+ let ( buftype, languageId, filename, line, character, handle) : ( String , String , String , u64 , u64 , bool ) =
2498
+ self . gather_args (
2499
+ & [
2500
+ VimVar :: Buftype ,
2501
+ VimVar :: LanguageId ,
2502
+ VimVar :: Filename ,
2503
+ VimVar :: Line ,
2504
+ VimVar :: Character ,
2505
+ VimVar :: Handle ,
2506
+ ] ,
2507
+ params,
2508
+ ) ?;
2509
+ if !buftype. is_empty ( ) || languageId. is_empty ( ) {
2510
+ return Ok ( Value :: Null ) ;
2511
+ }
2512
+
2513
+ let result = self . call (
2514
+ Some ( & languageId) ,
2515
+ REQUEST__CqueryDerived ,
2516
+ TextDocumentPositionParams {
2517
+ text_document : TextDocumentIdentifier {
2518
+ uri : filename. to_url ( ) ?,
2519
+ } ,
2520
+ position : Position { line, character } ,
2521
+ } ,
2522
+ ) ?;
2523
+
2524
+ if !handle {
2525
+ return Ok ( result) ;
2526
+ }
2527
+
2528
+ let locations: Vec < Location > = serde_json:: from_value ( result. clone ( ) ) ?;
2529
+ self . display_locations ( & locations, & languageId) ?;
2530
+
2531
+ info ! ( "End {}" , REQUEST__CqueryDerived ) ;
2532
+ Ok ( result)
2533
+ }
2534
+
2535
+ fn cquery_callers ( & self , params : & Option < Params > ) -> Result < Value > {
2536
+ info ! ( "Begin {}" , REQUEST__CqueryCallers ) ;
2537
+
2538
+ let ( buftype, languageId, filename, line, character, handle) : ( String , String , String , u64 , u64 , bool ) =
2539
+ self . gather_args (
2540
+ & [
2541
+ VimVar :: Buftype ,
2542
+ VimVar :: LanguageId ,
2543
+ VimVar :: Filename ,
2544
+ VimVar :: Line ,
2545
+ VimVar :: Character ,
2546
+ VimVar :: Handle ,
2547
+ ] ,
2548
+ params,
2549
+ ) ?;
2550
+ if !buftype. is_empty ( ) || languageId. is_empty ( ) {
2551
+ return Ok ( Value :: Null ) ;
2552
+ }
2553
+
2554
+ let result = self . call (
2555
+ Some ( & languageId) ,
2556
+ REQUEST__CqueryCallers ,
2557
+ TextDocumentPositionParams {
2558
+ text_document : TextDocumentIdentifier {
2559
+ uri : filename. to_url ( ) ?,
2560
+ } ,
2561
+ position : Position { line, character } ,
2562
+ } ,
2563
+ ) ?;
2564
+
2565
+ if !handle {
2566
+ return Ok ( result) ;
2567
+ }
2568
+
2569
+ let locations: Vec < Location > = serde_json:: from_value ( result. clone ( ) ) ?;
2570
+ self . display_locations ( & locations, & languageId) ?;
2571
+
2572
+ info ! ( "End {}" , REQUEST__CqueryCallers ) ;
2573
+ Ok ( result)
2574
+ }
2575
+
2576
+ fn cquery_vars ( & self , params : & Option < Params > ) -> Result < Value > {
2577
+ info ! ( "Begin {}" , REQUEST__CqueryVars ) ;
2578
+
2579
+ let ( buftype, languageId, filename, line, character, handle) : ( String , String , String , u64 , u64 , bool ) =
2580
+ self . gather_args (
2581
+ & [
2582
+ VimVar :: Buftype ,
2583
+ VimVar :: LanguageId ,
2584
+ VimVar :: Filename ,
2585
+ VimVar :: Line ,
2586
+ VimVar :: Character ,
2587
+ VimVar :: Handle ,
2588
+ ] ,
2589
+ params,
2590
+ ) ?;
2591
+ if !buftype. is_empty ( ) || languageId. is_empty ( ) {
2592
+ return Ok ( Value :: Null ) ;
2593
+ }
2594
+
2595
+ let result = self . call (
2596
+ Some ( & languageId) ,
2597
+ REQUEST__CqueryVars ,
2598
+ TextDocumentPositionParams {
2599
+ text_document : TextDocumentIdentifier {
2600
+ uri : filename. to_url ( ) ?,
2601
+ } ,
2602
+ position : Position { line, character } ,
2603
+ } ,
2604
+ ) ?;
2605
+
2606
+ if !handle {
2607
+ return Ok ( result) ;
2608
+ }
2609
+
2610
+ let locations: Vec < Location > = serde_json:: from_value ( result. clone ( ) ) ?;
2611
+ self . display_locations ( & locations, & languageId) ?;
2612
+
2613
+ info ! ( "End {}" , REQUEST__CqueryVars ) ;
2614
+ Ok ( result)
2615
+ }
2616
+
2449
2617
fn cquery_handleProgress ( & self , params : & Option < Params > ) -> Result < ( ) > {
2450
2618
info ! ( "Begin {}" , NOTIFICATION__CqueryProgress ) ;
2451
2619
let params: CqueryProgressParams = serde_json:: from_value ( params. clone ( ) . to_value ( ) ) ?;
0 commit comments