@@ -5,7 +5,7 @@ use vfs::{AbsPathBuf, FileId, Vfs};
5
5
6
6
use super :: { ConfigInput , LocalConfigData , RootLocalConfigData } ;
7
7
8
- #[ derive( Debug ) ]
8
+ #[ derive( Debug , PartialEq ) ]
9
9
pub enum ConfigTreeError {
10
10
Removed ,
11
11
NonExistent ,
@@ -654,4 +654,31 @@ mod tests {
654
654
let local = config_tree. local_config ( crate_a) ;
655
655
assert_eq ! ( local. completion_autoself_enable, false ) ;
656
656
}
657
+
658
+ #[ test]
659
+ fn ignore_irrelevant_vfs_changes ( ) {
660
+ tracing_subscriber:: fmt ( ) . try_init ( ) . ok ( ) ;
661
+ let mut vfs = Vfs :: default ( ) ;
662
+
663
+ let project_root = AbsPath :: assert ( "/root" ) ;
664
+ let xdg = alloc_file_id ( & mut vfs, XDG_CONFIG_HOME_RATOML ) ;
665
+ let mut config_tree = ConfigDb :: new ( xdg, project_root. to_path_buf ( ) ) ;
666
+
667
+ // The main way an irrelevant vfs file change is going to show up is in TOML parse errors.
668
+ let invalid_utf8 = b"\xc3 \x28 " ;
669
+ vfs. set_file_contents (
670
+ AbsPath :: assert ( "/irrelevant/file.bin" ) . to_path_buf ( ) . into ( ) ,
671
+ Some ( invalid_utf8. to_vec ( ) ) ,
672
+ ) ;
673
+ let errors = config_tree. apply_changes (
674
+ ConfigChanges {
675
+ client_change : None ,
676
+ set_project_root : None ,
677
+ set_source_roots : None ,
678
+ ra_toml_changes : vfs. take_changes ( ) ,
679
+ } ,
680
+ & mut vfs,
681
+ ) ;
682
+ assert_eq ! ( errors, vec![ ] ) ;
683
+ }
657
684
}
0 commit comments