update instructions, include steel submodule

pull/8675/merge^2
mattwparas 5 months ago
parent 41c487d8d5
commit 14cd995ba2

3
.gitmodules vendored

@ -0,0 +1,3 @@
[submodule "steel"]
path = steel
url = https://github.com/mattwparas/steel.git

@ -1,42 +1,27 @@
# Building
You will need a handful of things:
You will need:
* A clone of this fork, on the branch `steel-event-system`
* A clone of the steel git repo -> https://github.com/mattwparas/steel, on the branch `master` (default)
I also cannot promise that this will work on windows. I develop off of ubuntu and mac, so for now you can probably safely assume it will work on unix.
The `Cargo.toml` for helix points to a local development version of steel. Set this up so that it points to wherever you've cloned steel:
```
[workspace.dependencies]
# CHANGE 'path = ...' to point to the path to steel-core
steel-core = { path = "/home/matt/code/scratch/steel/crates/steel-core", version = "0.6.0", features = ["anyhow", "dylibs"] }
```
Since I'm actively developing steel alongside the helix integration in order to make things as smooth as possible, its not referencing a published version yet.
## Installing Steel
Follow the instructions here https://github.com/mattwparas/steel and https://github.com/mattwparas/steel/issues/71
Setting a `STEEL_HOME` env var, then running `cargo run -- cogs/install.scm` in the root of that repo will set up the steel core libraries so that helix can reference them.
`steel` is included as a git submodule for ease of building.
## Installing helix
Once you're set up with steel, just run
Just run
`cargo xtask steel`
`cargo install --path helix-term --locked`
To install the `hx` executable, with steel as a plugin language. This also includes:
To install the `hx` executable, with steel as the plugin language.
The `steel` executable, the steel language server, the steel dylib installer, and the steel standard library.
## Setting up configurations for helix
Note, this API is entirely subjet to change, and I promise absolutely 0 backwards compatibility while this is in development.
There are 2 important files you'll want:
There are 2 important files you'll want, which should be auto generated during the installation process:
* `~/.config/helix/helix.scm`
* `~/.config/helix/init.scm`

@ -13,6 +13,10 @@ use helix_vcs::{FileChange, Hunk};
pub use lsp::*;
pub use engine::ScriptingEngine;
#[cfg(feature = "steel")]
pub use engine::steel::{helix_module_file, steel_init_file};
use tui::{
text::Span,
widgets::{Cell, Row},

@ -0,0 +1 @@
Subproject commit b1618afc56ab755360222ecbf720f0ebfa6806ca

@ -15,6 +15,8 @@ pub mod tasks {
use crate::querycheck::query_check;
use crate::DynError;
use std::path::{Path, PathBuf};
pub fn docgen() -> Result<(), DynError> {
write(TYPABLE_COMMANDS_MD_OUTPUT, &typable_commands()?);
write(LANG_SUPPORT_MD_OUTPUT, &lang_features()?);
@ -30,7 +32,60 @@ pub mod tasks {
}
pub fn install_steel() {
fn workspace_dir() -> PathBuf {
let output = std::process::Command::new(env!("CARGO"))
.arg("locate-project")
.arg("--workspace")
.arg("--message-format=plain")
.output()
.unwrap()
.stdout;
let cargo_path = Path::new(std::str::from_utf8(&output).unwrap().trim());
cargo_path.parent().unwrap().to_path_buf()
}
// Update the steel submodule
std::process::Command::new("git")
.args(["submodule", "init"])
.spawn()
.unwrap()
.wait()
.unwrap();
std::process::Command::new("git")
.args(["submodule", "foreach", "git", "pull", "origin", "master"])
.spawn()
.unwrap()
.wait()
.unwrap();
let mut workspace_dir = workspace_dir();
workspace_dir.push("steel");
std::process::Command::new("cargo")
.args(["xtask", "install"])
.current_dir(workspace_dir)
.spawn()
.unwrap()
.wait()
.unwrap();
println!("=> Finished installing steel");
code_gen();
let helix_scm_path = helix_term::commands::helix_module_file();
let steel_init_path = helix_term::commands::steel_init_file();
if !helix_scm_path.exists() {
std::fs::File::create(helix_scm_path).expect("Unable to create new helix.scm file!");
}
if !steel_init_path.exists() {
std::fs::File::create(steel_init_path).expect("Unable to create new init.scm file!");
}
std::process::Command::new("cargo")
.args(["install", "--path", "helix-term", "--locked", "--force"])
.spawn()

Loading…
Cancel
Save