@@ -565,6 +565,7 @@ pub struct Config {
565565 data : ConfigData ,
566566 detached_files : Vec < AbsPathBuf > ,
567567 snippets : Vec < Snippet > ,
568+ is_visual_studio : bool ,
568569}
569570
570571type ParallelCachePrimingNumThreads = u8 ;
@@ -760,6 +761,7 @@ impl Config {
760761 root_path : AbsPathBuf ,
761762 caps : ClientCapabilities ,
762763 workspace_roots : Vec < AbsPathBuf > ,
764+ is_visual_studio : bool ,
763765 ) -> Self {
764766 Config {
765767 caps,
@@ -769,6 +771,7 @@ impl Config {
769771 root_path,
770772 snippets : Default :: default ( ) ,
771773 workspace_roots,
774+ is_visual_studio,
772775 }
773776 }
774777
@@ -1667,6 +1670,12 @@ impl Config {
16671670 pub fn typing_autoclose_angle ( & self ) -> bool {
16681671 self . data . typing_autoClosingAngleBrackets_enable
16691672 }
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 ( & self ) -> bool {
1677+ self . is_visual_studio
1678+ }
16701679}
16711680// Deserialization definitions
16721681
@@ -2555,8 +2564,12 @@ mod tests {
25552564
25562565 #[ test]
25572566 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+ ) ;
25602573 config
25612574 . update ( serde_json:: json!( {
25622575 "procMacro_server" : null,
@@ -2567,8 +2580,12 @@ mod tests {
25672580
25682581 #[ test]
25692582 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+ ) ;
25722589 config
25732590 . update ( serde_json:: json!( {
25742591 "procMacro" : { "server" : project_root( ) . display( ) . to_string( ) }
@@ -2579,8 +2596,12 @@ mod tests {
25792596
25802597 #[ test]
25812598 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+ ) ;
25842605 config
25852606 . update ( serde_json:: json!( {
25862607 "procMacro" : { "server" : "./server" }
0 commit comments