1- use std:: { collections:: BTreeMap , marker:: PhantomData } ;
1+ use std:: collections:: BTreeMap ;
2+ #[ cfg( any( feature = "server" , feature = "macros" ) ) ]
3+ use std:: marker:: PhantomData ;
24
5+ #[ cfg( any( feature = "server" , feature = "macros" ) ) ]
36use pastey:: paste;
47use serde:: { Deserialize , Serialize } ;
58
@@ -300,6 +303,7 @@ pub struct ServerCapabilities {
300303 pub tasks : Option < TasksCapability > ,
301304}
302305
306+ #[ cfg( any( feature = "server" , feature = "macros" ) ) ]
303307macro_rules! builder {
304308 ( $Target: ident { $( $f: ident: $T: ty) ,* $( , ) ?} ) => {
305309 paste! {
@@ -405,6 +409,7 @@ macro_rules! builder {
405409 }
406410}
407411
412+ #[ cfg( any( feature = "server" , feature = "macros" ) ) ]
408413builder ! {
409414 ServerCapabilities {
410415 experimental: ExperimentalCapabilities ,
@@ -418,6 +423,7 @@ builder! {
418423 }
419424}
420425
426+ #[ cfg( any( feature = "server" , feature = "macros" ) ) ]
421427impl <
422428 const E : bool ,
423429 const EXT : bool ,
@@ -436,6 +442,7 @@ impl<
436442 }
437443}
438444
445+ #[ cfg( any( feature = "server" , feature = "macros" ) ) ]
439446impl <
440447 const E : bool ,
441448 const EXT : bool ,
@@ -454,6 +461,7 @@ impl<
454461 }
455462}
456463
464+ #[ cfg( any( feature = "server" , feature = "macros" ) ) ]
457465impl <
458466 const E : bool ,
459467 const EXT : bool ,
@@ -479,6 +487,7 @@ impl<
479487 }
480488}
481489
490+ #[ cfg( any( feature = "server" , feature = "macros" ) ) ]
482491builder ! {
483492 ClientCapabilities {
484493 experimental: ExperimentalCapabilities ,
@@ -490,6 +499,7 @@ builder! {
490499 }
491500}
492501
502+ #[ cfg( any( feature = "server" , feature = "macros" ) ) ]
493503impl < const E : bool , const EXT : bool , const S : bool , const EL : bool , const TASKS : bool >
494504 ClientCapabilitiesBuilder < ClientCapabilitiesBuilderState < E , EXT , true , S , EL , TASKS > >
495505{
@@ -501,6 +511,7 @@ impl<const E: bool, const EXT: bool, const S: bool, const EL: bool, const TASKS:
501511 }
502512}
503513
514+ #[ cfg( any( feature = "server" , feature = "macros" ) ) ]
504515impl < const E : bool , const EXT : bool , const R : bool , const EL : bool , const TASKS : bool >
505516 ClientCapabilitiesBuilder < ClientCapabilitiesBuilderState < E , EXT , R , true , EL , TASKS > >
506517{
@@ -521,7 +532,7 @@ impl<const E: bool, const EXT: bool, const R: bool, const EL: bool, const TASKS:
521532 }
522533}
523534
524- #[ cfg( feature = "elicitation" ) ]
535+ #[ cfg( all ( feature = "elicitation" , any ( feature = "server" , feature = "macros" ) ) ) ]
525536impl < const E : bool , const EXT : bool , const R : bool , const S : bool , const TASKS : bool >
526537 ClientCapabilitiesBuilder < ClientCapabilitiesBuilderState < E , EXT , R , S , true , TASKS > >
527538{
@@ -539,6 +550,7 @@ impl<const E: bool, const EXT: bool, const R: bool, const S: bool, const TASKS:
539550}
540551
541552#[ cfg( test) ]
553+ #[ cfg( any( feature = "server" , feature = "macros" ) ) ]
542554mod test {
543555 use super :: * ;
544556 #[ test]
0 commit comments