Skip to content

Commit 87f3927

Browse files
committed
bootstrap: Add support for ./x setup helix
1 parent 8627ee8 commit 87f3927

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

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

+8
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 {
@@ -544,6 +545,9 @@ impl EditorKind {
544545
EditorKind::Emacs => vec![
545546
"51068d4747a13732440d1a8b8f432603badb1864fa431d83d0fd4f8fa57039e0"
546547
],
548+
EditorKind::Helix => vec![
549+
"2d3069b8cf1b977e5d4023965eb6199597755e6c96c185ed5f2854f98b83d233"
550+
]
547551
}
548552
}
549553

@@ -555,20 +559,23 @@ impl EditorKind {
555559
match self {
556560
EditorKind::Vscode => PathBuf::new().join(".vscode").join("settings.json"),
557561
EditorKind::Emacs => PathBuf::new().join(".dir-locals.el"),
562+
EditorKind::Helix => PathBuf::new().join(".helix").join("languages.toml"),
558563
}
559564
}
560565

561566
fn settings(&self) -> &str {
562567
match self {
563568
EditorKind::Vscode => include_str!("../../../../etc/rust_analyzer_settings.json"),
564569
EditorKind::Emacs => include_str!("../../../../etc/rust_analyzer_eglot.el"),
570+
EditorKind::Helix => include_str!("../../../../etc/rust_analyzer_helix.toml"),
565571
}
566572
}
567573

568574
fn backup_extension(&self) -> &str {
569575
match self {
570576
EditorKind::Vscode => "json.bak",
571577
EditorKind::Emacs => "el.bak",
578+
EditorKind::Helix => "toml.bak",
572579
}
573580
}
574581
}
@@ -612,6 +619,7 @@ macro_rules! impl_editor_support {
612619

613620
impl_editor_support!(vscode, Vscode);
614621
impl_editor_support!(emacs, Emacs);
622+
impl_editor_support!(helix, Helix);
615623

616624
/// Create the recommended editor LSP config file for rustc development, or just print it
617625
/// 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)