@@ -565,6 +565,7 @@ pub struct Config {
565
565
data : ConfigData ,
566
566
detached_files : Vec < AbsPathBuf > ,
567
567
snippets : Vec < Snippet > ,
568
+ is_visual_studio_code : bool ,
568
569
}
569
570
570
571
type ParallelCachePrimingNumThreads = u8 ;
@@ -760,6 +761,7 @@ impl Config {
760
761
root_path : AbsPathBuf ,
761
762
caps : ClientCapabilities ,
762
763
workspace_roots : Vec < AbsPathBuf > ,
764
+ is_visual_studio_code : bool ,
763
765
) -> Self {
764
766
Config {
765
767
caps,
@@ -769,6 +771,7 @@ impl Config {
769
771
root_path,
770
772
snippets : Default :: default ( ) ,
771
773
workspace_roots,
774
+ is_visual_studio_code,
772
775
}
773
776
}
774
777
@@ -1667,6 +1670,12 @@ impl Config {
1667
1670
pub fn typing_autoclose_angle ( & self ) -> bool {
1668
1671
self . data . typing_autoClosingAngleBrackets_enable
1669
1672
}
1673
+
1674
+ // FIXME: VSCode seems to work wrong sometimes, see https://github.com/microsoft/vscode/issues/193124
1675
+ // hence, distinguish it for now.
1676
+ pub fn is_visual_studio_code ( & self ) -> bool {
1677
+ self . is_visual_studio_code
1678
+ }
1670
1679
}
1671
1680
// Deserialization definitions
1672
1681
@@ -2555,8 +2564,12 @@ mod tests {
2555
2564
2556
2565
#[ test]
2557
2566
fn proc_macro_srv_null ( ) {
2558
- let mut config =
2559
- Config :: new ( AbsPathBuf :: try_from ( project_root ( ) ) . unwrap ( ) , Default :: default ( ) , vec ! [ ] ) ;
2567
+ let mut config = Config :: new (
2568
+ AbsPathBuf :: try_from ( project_root ( ) ) . unwrap ( ) ,
2569
+ Default :: default ( ) ,
2570
+ vec ! [ ] ,
2571
+ false ,
2572
+ ) ;
2560
2573
config
2561
2574
. update ( serde_json:: json!( {
2562
2575
"procMacro_server" : null,
@@ -2567,8 +2580,12 @@ mod tests {
2567
2580
2568
2581
#[ test]
2569
2582
fn proc_macro_srv_abs ( ) {
2570
- let mut config =
2571
- Config :: new ( AbsPathBuf :: try_from ( project_root ( ) ) . unwrap ( ) , Default :: default ( ) , vec ! [ ] ) ;
2583
+ let mut config = Config :: new (
2584
+ AbsPathBuf :: try_from ( project_root ( ) ) . unwrap ( ) ,
2585
+ Default :: default ( ) ,
2586
+ vec ! [ ] ,
2587
+ false ,
2588
+ ) ;
2572
2589
config
2573
2590
. update ( serde_json:: json!( {
2574
2591
"procMacro" : { "server" : project_root( ) . display( ) . to_string( ) }
@@ -2579,8 +2596,12 @@ mod tests {
2579
2596
2580
2597
#[ test]
2581
2598
fn proc_macro_srv_rel ( ) {
2582
- let mut config =
2583
- Config :: new ( AbsPathBuf :: try_from ( project_root ( ) ) . unwrap ( ) , Default :: default ( ) , vec ! [ ] ) ;
2599
+ let mut config = Config :: new (
2600
+ AbsPathBuf :: try_from ( project_root ( ) ) . unwrap ( ) ,
2601
+ Default :: default ( ) ,
2602
+ vec ! [ ] ,
2603
+ false ,
2604
+ ) ;
2584
2605
config
2585
2606
. update ( serde_json:: json!( {
2586
2607
"procMacro" : { "server" : "./server" }
0 commit comments