Skip to content

Commit dfc7e39

Browse files
committed
bootstrap: Add support for ./x setup helix
1 parent c53d4c7 commit dfc7e39

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

src/bootstrap/src/core/build_steps/setup.rs

+9
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,7 @@ undesirable, simply delete the `pre-push` file from .git/hooks."
523523
enum EditorKind {
524524
Vscode,
525525
Emacs,
526+
Helix,
526527
}
527528

528529
impl EditorKind {
@@ -545,6 +546,9 @@ impl EditorKind {
545546
"51068d4747a13732440d1a8b8f432603badb1864fa431d83d0fd4f8fa57039e0",
546547
"d29af4d949bbe2371eac928a3c31cf9496b1701aa1c45f11cd6c759865ad5c45",
547548
],
549+
EditorKind::Helix => vec![
550+
"2d3069b8cf1b977e5d4023965eb6199597755e6c96c185ed5f2854f98b83d233"
551+
]
548552
}
549553
}
550554

@@ -556,27 +560,31 @@ impl EditorKind {
556560
self.settings_folder().join(match self {
557561
EditorKind::Vscode => "settings.json",
558562
EditorKind::Emacs => ".dir-locals.el",
563+
EditorKind::Helix => "languages.toml",
559564
})
560565
}
561566

562567
fn settings_folder(&self) -> PathBuf {
563568
match self {
564569
EditorKind::Vscode => PathBuf::new().join(".vscode"),
565570
EditorKind::Emacs => PathBuf::new(),
571+
EditorKind::Helix => PathBuf::new().join(".helix"),
566572
}
567573
}
568574

569575
fn settings_template(&self) -> &str {
570576
match self {
571577
EditorKind::Vscode => include_str!("../../../../etc/rust_analyzer_settings.json"),
572578
EditorKind::Emacs => include_str!("../../../../etc/rust_analyzer_eglot.el"),
579+
EditorKind::Helix => include_str!("../../../../etc/rust_analyzer_helix.toml"),
573580
}
574581
}
575582

576583
fn backup_extension(&self) -> &str {
577584
match self {
578585
EditorKind::Vscode => "json.bak",
579586
EditorKind::Emacs => "el.bak",
587+
EditorKind::Helix => "toml.bak",
580588
}
581589
}
582590
}
@@ -620,6 +628,7 @@ macro_rules! impl_editor_support {
620628

621629
impl_editor_support!(vscode, Vscode);
622630
impl_editor_support!(emacs, Emacs);
631+
impl_editor_support!(helix, Helix);
623632

624633
/// Create the recommended editor LSP config file for rustc development, or just print it
625634
/// If this method should be re-called, it returns `false`.

src/bootstrap/src/core/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ impl<'a> Builder<'a> {
10011001
run::GenerateCompletions,
10021002
),
10031003
Kind::Setup => {
1004-
describe!(setup::Profile, setup::Hook, setup::Link, setup::Vscode, setup::Emacs)
1004+
describe!(setup::Profile, setup::Hook, setup::Link, setup::Vscode, setup::Emacs, setup::Helix)
10051005
}
10061006
Kind::Clean => describe!(clean::CleanAll, clean::Rustc, clean::Std),
10071007
Kind::Vendor => describe!(vendor::Vendor),

src/bootstrap/src/core/config/flags.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -451,11 +451,12 @@ Arguments:
451451
./x.py setup hook
452452
./x.py setup vscode
453453
./x.py setup emacs
454+
./x.py setup helix
454455
./x.py setup link", Profile::all_for_help(" ").trim_end()))]
455456
Setup {
456457
/// Either the profile for `config.toml` or another setup action.
457458
/// May be omitted to set up interactively
458-
#[arg(value_name = "<PROFILE>|hook|vscode|emacs|link")]
459+
#[arg(value_name = "<PROFILE>|hook|vscode|emacs|helix|link")]
459460
profile: Option<PathBuf>,
460461
},
461462
/// Suggest a subset of tests to run, based on modified files

src/etc/completions/x.py.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2741,7 +2741,7 @@ _x.py() {
27412741
return 0
27422742
;;
27432743
x.py__setup)
2744-
opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [<PROFILE>|hook|vscode|emacs|link] [PATHS]... [ARGS]..."
2744+
opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --help [<PROFILE>|hook|vscode|emacs|helix|link] [PATHS]... [ARGS]..."
27452745
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
27462746
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
27472747
return 0

0 commit comments

Comments
 (0)