about summary refs log tree commit diff
diff options
context:
space:
mode:
authorKajetan Puchalski <kajetan.puchalski@kajetanp.co.uk>2024-09-30 22:26:22 +0100
committerKajetan Puchalski <kajetan.puchalski@kajetanp.co.uk>2024-10-01 12:59:55 +0100
commitdfc7e396a6426211078b24fe0a2c8f29adcbe2f2 (patch)
treecbdd2137d16c8f683ce2bbc66aaeea4339b3d304
parentc53d4c78ad54a0eb2a117b5d47aa18b3c2bff484 (diff)
downloadrust-dfc7e396a6426211078b24fe0a2c8f29adcbe2f2.tar.gz
rust-dfc7e396a6426211078b24fe0a2c8f29adcbe2f2.zip
bootstrap: Add support for ./x setup helix
-rw-r--r--src/bootstrap/src/core/build_steps/setup.rs9
-rw-r--r--src/bootstrap/src/core/builder.rs2
-rw-r--r--src/bootstrap/src/core/config/flags.rs3
-rw-r--r--src/etc/completions/x.py.sh2
4 files changed, 13 insertions, 3 deletions
diff --git a/src/bootstrap/src/core/build_steps/setup.rs b/src/bootstrap/src/core/build_steps/setup.rs
index 7fbc5de06df..2b5700699c4 100644
--- a/src/bootstrap/src/core/build_steps/setup.rs
+++ b/src/bootstrap/src/core/build_steps/setup.rs
@@ -523,6 +523,7 @@ undesirable, simply delete the `pre-push` file from .git/hooks."
 enum EditorKind {
     Vscode,
     Emacs,
+    Helix,
 }
 
 impl EditorKind {
@@ -545,6 +546,9 @@ impl EditorKind {
                 "51068d4747a13732440d1a8b8f432603badb1864fa431d83d0fd4f8fa57039e0",
                 "d29af4d949bbe2371eac928a3c31cf9496b1701aa1c45f11cd6c759865ad5c45",
             ],
+            EditorKind::Helix => vec![
+                "2d3069b8cf1b977e5d4023965eb6199597755e6c96c185ed5f2854f98b83d233"
+            ]
         }
     }
 
@@ -556,6 +560,7 @@ impl EditorKind {
         self.settings_folder().join(match self {
             EditorKind::Vscode => "settings.json",
             EditorKind::Emacs => ".dir-locals.el",
+            EditorKind::Helix => "languages.toml",
         })
     }
 
@@ -563,6 +568,7 @@ impl EditorKind {
         match self {
             EditorKind::Vscode => PathBuf::new().join(".vscode"),
             EditorKind::Emacs => PathBuf::new(),
+            EditorKind::Helix => PathBuf::new().join(".helix"),
         }
     }
 
@@ -570,6 +576,7 @@ impl EditorKind {
         match self {
             EditorKind::Vscode => include_str!("../../../../etc/rust_analyzer_settings.json"),
             EditorKind::Emacs => include_str!("../../../../etc/rust_analyzer_eglot.el"),
+            EditorKind::Helix => include_str!("../../../../etc/rust_analyzer_helix.toml"),
         }
     }
 
@@ -577,6 +584,7 @@ impl EditorKind {
         match self {
             EditorKind::Vscode => "json.bak",
             EditorKind::Emacs => "el.bak",
+            EditorKind::Helix => "toml.bak",
         }
     }
 }
@@ -620,6 +628,7 @@ macro_rules! impl_editor_support {
 
 impl_editor_support!(vscode, Vscode);
 impl_editor_support!(emacs, Emacs);
+impl_editor_support!(helix, Helix);
 
 /// Create the recommended editor LSP config file for rustc development, or just print it
 /// If this method should be re-called, it returns `false`.
diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs
index 91ac9cceb38..dcffeccbaff 100644
--- a/src/bootstrap/src/core/builder.rs
+++ b/src/bootstrap/src/core/builder.rs
@@ -1001,7 +1001,7 @@ impl<'a> Builder<'a> {
                 run::GenerateCompletions,
             ),
             Kind::Setup => {
-                describe!(setup::Profile, setup::Hook, setup::Link, setup::Vscode, setup::Emacs)
+                describe!(setup::Profile, setup::Hook, setup::Link, setup::Vscode, setup::Emacs, setup::Helix)
             }
             Kind::Clean => describe!(clean::CleanAll, clean::Rustc, clean::Std),
             Kind::Vendor => describe!(vendor::Vendor),
diff --git a/src/bootstrap/src/core/config/flags.rs b/src/bootstrap/src/core/config/flags.rs
index 73446382cc6..2957e47c771 100644
--- a/src/bootstrap/src/core/config/flags.rs
+++ b/src/bootstrap/src/core/config/flags.rs
@@ -451,11 +451,12 @@ Arguments:
         ./x.py setup hook
         ./x.py setup vscode
         ./x.py setup emacs
+        ./x.py setup helix
         ./x.py setup link", Profile::all_for_help("        ").trim_end()))]
     Setup {
         /// Either the profile for `config.toml` or another setup action.
         /// May be omitted to set up interactively
-        #[arg(value_name = "<PROFILE>|hook|vscode|emacs|link")]
+        #[arg(value_name = "<PROFILE>|hook|vscode|emacs|helix|link")]
         profile: Option<PathBuf>,
     },
     /// Suggest a subset of tests to run, based on modified files
diff --git a/src/etc/completions/x.py.sh b/src/etc/completions/x.py.sh
index 78d59c229d7..15475b976ea 100644
--- a/src/etc/completions/x.py.sh
+++ b/src/etc/completions/x.py.sh
@@ -2741,7 +2741,7 @@ _x.py() {
             return 0
             ;;
         x.py__setup)
-            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]..."
+            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]..."
             if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                 COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                 return 0