@@ -292,6 +292,9 @@ impl ConfigTree {
292
292
let node = self . tree . get_mut ( node_id) . ok_or ( ConfigTreeError :: NonExistent ) ?;
293
293
node. get_mut ( ) . input = input;
294
294
295
+ // We won't do any funny business comparing the previous input to the new one, because
296
+ // that would require implementing PartialEq on the dozens and dozens of types that make
297
+ // up ConfigInput.
295
298
self . invalidate_subtree ( node_id) ;
296
299
// tracing::trace!("invalidated subtree:\n{:#?}", node_id.debug_pretty_print(&self.tree));
297
300
Ok ( node_id)
@@ -495,6 +498,12 @@ mod tests {
495
498
# default is "never"
496
499
[inlayHints.discriminantHints]
497
500
enable = "always"
501
+ [completion.autoself]
502
+ enable = true
503
+ [completion.autoimport]
504
+ enable = true
505
+ [semanticHighlighting.strings]
506
+ enable = true
498
507
"#
499
508
. to_string ( )
500
509
. into_bytes ( ) ,
@@ -510,13 +519,20 @@ mod tests {
510
519
511
520
let prev = local;
512
521
let local = config_tree. read_config ( crate_a) . unwrap ( ) ;
522
+ // Should have been recomputed
513
523
assert ! ( !Arc :: ptr_eq( & prev, & local) ) ;
514
- let local2 = config_tree . read_config ( crate_a ) . unwrap ( ) ;
515
- assert ! ( Arc :: ptr_eq( & local, & local2 ) ) ;
524
+ // But without changes in between, should give the same Arc back
525
+ assert ! ( Arc :: ptr_eq( & local, & config_tree . read_config ( crate_a ) . unwrap ( ) ) ) ;
516
526
527
+ // The newly added xdg_config_file_id should affect the output if nothing else touches
528
+ // this key
517
529
assert_eq ! (
518
530
local. inlayHints_discriminantHints_enable,
519
531
crate :: config:: DiscriminantHintsDef :: Always
520
532
) ;
533
+ // But it should not win
534
+ assert_eq ! ( local. completion_autoself_enable, false ) ;
535
+ assert_eq ! ( local. completion_autoimport_enable, false ) ;
536
+ assert_eq ! ( local. semanticHighlighting_strings_enable, false ) ;
521
537
}
522
538
}
0 commit comments