File tree 2 files changed +26
-12
lines changed
src/bootstrap/src/core/build_steps
2 files changed +26
-12
lines changed Original file line number Diff line number Diff line change @@ -531,6 +531,16 @@ enum EditorKind {
531
531
}
532
532
533
533
impl EditorKind {
534
+ // Used in `./tests.rs`.
535
+ #[ allow( dead_code) ]
536
+ pub const ALL : & [ EditorKind ] = & [
537
+ EditorKind :: Emacs ,
538
+ EditorKind :: Helix ,
539
+ EditorKind :: Vim ,
540
+ EditorKind :: VsCode ,
541
+ EditorKind :: Zed ,
542
+ ] ;
543
+
534
544
fn prompt_user ( ) -> io:: Result < Option < EditorKind > > {
535
545
let prompt_str = "Available editors:
536
546
1. Emacs
@@ -575,9 +585,10 @@ Select which editor you would like to set up [default: None]: ";
575
585
"51068d4747a13732440d1a8b8f432603badb1864fa431d83d0fd4f8fa57039e0" ,
576
586
"d29af4d949bbe2371eac928a3c31cf9496b1701aa1c45f11cd6c759865ad5c45" ,
577
587
] ,
578
- EditorKind :: Helix => {
579
- & [ "2d3069b8cf1b977e5d4023965eb6199597755e6c96c185ed5f2854f98b83d233" ]
580
- }
588
+ EditorKind :: Helix => & [
589
+ "2d3069b8cf1b977e5d4023965eb6199597755e6c96c185ed5f2854f98b83d233" ,
590
+ "6736d61409fbebba0933afd2e4c44ff2f97c1cb36cf0299a7f4a7819b8775040" ,
591
+ ] ,
581
592
EditorKind :: Vim | EditorKind :: VsCode => & [
582
593
"ea67e259dedf60d4429b6c349a564ffcd1563cf41c920a856d1f5b16b4701ac8" ,
583
594
"56e7bf011c71c5d81e0bf42e84938111847a810eee69d906bba494ea90b51922" ,
Original file line number Diff line number Diff line change @@ -5,13 +5,16 @@ use crate::utils::helpers::hex_encode;
5
5
6
6
#[ test]
7
7
fn check_matching_settings_hash ( ) {
8
- let editor = EditorKind :: Vscode ;
9
- let mut hasher = sha2:: Sha256 :: new ( ) ;
10
- hasher. update ( & editor. settings_template ( ) ) ;
11
- let hash = hex_encode ( hasher. finalize ( ) . as_slice ( ) ) ;
12
- assert_eq ! (
13
- & hash,
14
- editor. hashes( ) . last( ) . unwrap( ) ,
15
- "Update `EditorKind::hashes()` with the new hash of `src/etc/rust_analyzer_settings.json`"
16
- ) ;
8
+ for editor in EditorKind :: ALL {
9
+ let mut hasher = sha2:: Sha256 :: new ( ) ;
10
+ hasher. update ( & editor. settings_template ( ) ) ;
11
+ let hash = hex_encode ( hasher. finalize ( ) . as_slice ( ) ) ;
12
+ assert_eq ! (
13
+ & hash,
14
+ editor. hashes( ) . last( ) . unwrap( ) ,
15
+ "Update `EditorKind::hashes()` with the new hash of `{}` for `EditorKind::{:?}`" ,
16
+ editor. settings_template( ) ,
17
+ editor,
18
+ ) ;
19
+ }
17
20
}
You can’t perform that action at this time.
0 commit comments