From 170e5068cdc90405ce4077efc0a9f686f1faf3d5 Mon Sep 17 00:00:00 2001 From: Matt Paras Date: Fri, 25 Apr 2025 22:08:43 -0700 Subject: [PATCH 1/4] wip --- Cargo.lock | 207 ++++-------------------- helix-term/src/commands/engine.rs | 2 + helix-term/src/commands/engine/steel.rs | 35 +++- 3 files changed, 62 insertions(+), 182 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7dd3fc127..21dd0d28c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -165,7 +165,7 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -523,27 +523,6 @@ dependencies = [ "parking_lot_core", ] -[[package]] -name = "dirs" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" -dependencies = [ - "libc", - "option-ext", - "redox_users", - "windows-sys 0.48.0", -] - [[package]] name = "displaydoc" version = "0.2.5" @@ -1899,17 +1878,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "http" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - [[package]] name = "httparse" version = "1.10.1" @@ -2298,7 +2266,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -2429,20 +2397,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "num" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - [[package]] name = "num-bigint" version = "0.4.6" @@ -2454,16 +2408,6 @@ dependencies = [ "serde", ] -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", - "serde", -] - [[package]] name = "num-integer" version = "0.1.46" @@ -2473,17 +2417,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-rational" version = "0.4.2" @@ -2493,7 +2426,6 @@ dependencies = [ "num-bigint", "num-integer", "num-traits", - "serde", ] [[package]] @@ -2541,12 +2473,6 @@ dependencies = [ "pathdiff", ] -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - [[package]] name = "parking_lot" version = "0.12.3" @@ -2567,7 +2493,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -2815,17 +2741,6 @@ dependencies = [ "bitflags", ] -[[package]] -name = "redox_users" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" -dependencies = [ - "getrandom 0.2.15", - "libredox", - "thiserror 1.0.69", -] - [[package]] name = "regex" version = "1.11.1" @@ -3151,7 +3066,7 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "steel-core" version = "0.6.0" -source = "git+https://github.com/mattwparas/steel.git#2f28ab10523198726d343257d29d892864e897b0" +source = "git+https://github.com/mattwparas/steel.git#890d3595d8e01ed39915ed4292ab441c1be7dbca" dependencies = [ "abi_stable", "anyhow", @@ -3162,31 +3077,31 @@ dependencies = [ "chrono", "codespan-reporting", "compact_str", - "crossbeam", - "dirs", + "crossbeam-channel", + "crossbeam-utils", + "env_home", "futures-executor", "futures-task", "futures-util", "fxhash", "getrandom 0.3.2", - "home", - "http", "httparse", "im", "im-lists", "im-rc", "lasso", "log", - "num", + "num-bigint", + "num-integer", + "num-rational", + "num-traits", "once_cell", "parking_lot", "polling", - "pretty", "quickscope", "radix_fmt", "rand 0.9.0", "serde", - "serde_derive", "serde_json", "smallvec", "stacker", @@ -3202,7 +3117,7 @@ dependencies = [ [[package]] name = "steel-derive" version = "0.5.0" -source = "git+https://github.com/mattwparas/steel.git#2f28ab10523198726d343257d29d892864e897b0" +source = "git+https://github.com/mattwparas/steel.git#890d3595d8e01ed39915ed4292ab441c1be7dbca" dependencies = [ "proc-macro2", "quote", @@ -3212,7 +3127,7 @@ dependencies = [ [[package]] name = "steel-doc" version = "0.6.0" -source = "git+https://github.com/mattwparas/steel.git#2f28ab10523198726d343257d29d892864e897b0" +source = "git+https://github.com/mattwparas/steel.git#890d3595d8e01ed39915ed4292ab441c1be7dbca" dependencies = [ "steel-core", ] @@ -3220,26 +3135,26 @@ dependencies = [ [[package]] name = "steel-gen" version = "0.2.0" -source = "git+https://github.com/mattwparas/steel.git#2f28ab10523198726d343257d29d892864e897b0" +source = "git+https://github.com/mattwparas/steel.git#890d3595d8e01ed39915ed4292ab441c1be7dbca" dependencies = [ "codegen", "serde", - "serde_derive", ] [[package]] name = "steel-parser" version = "0.6.0" -source = "git+https://github.com/mattwparas/steel.git#2f28ab10523198726d343257d29d892864e897b0" +source = "git+https://github.com/mattwparas/steel.git#890d3595d8e01ed39915ed4292ab441c1be7dbca" dependencies = [ "compact_str", "fxhash", "lasso", - "num", + "num-bigint", + "num-rational", + "num-traits", "once_cell", "pretty", "serde", - "serde_derive", "smallvec", ] @@ -3778,7 +3693,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -3787,22 +3702,13 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -3811,22 +3717,7 @@ version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-targets", ] [[package]] @@ -3835,46 +3726,28 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -3887,48 +3760,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" diff --git a/helix-term/src/commands/engine.rs b/helix-term/src/commands/engine.rs index 6a5abbfd4..f557fc829 100644 --- a/helix-term/src/commands/engine.rs +++ b/helix-term/src/commands/engine.rs @@ -141,9 +141,11 @@ impl ScriptingEngine { } pub fn generate_sources() { + let now = std::time::Instant::now(); for kind in PLUGIN_PRECEDENCE { manual_dispatch!(kind, generate_sources()) } + println!("Time taken: {:?}", now.elapsed()); } } diff --git a/helix-term/src/commands/engine/steel.rs b/helix-term/src/commands/engine/steel.rs index a9b9c470c..b3f1ef78b 100644 --- a/helix-term/src/commands/engine/steel.rs +++ b/helix-term/src/commands/engine/steel.rs @@ -423,7 +423,13 @@ fn load_static_commands(engine: &mut Engine, generate_sources: bool) { target_directory.push("static.scm"); - std::fs::write(target_directory, builtin_static_command_module).unwrap(); + std::fs::write(target_directory, &builtin_static_command_module).unwrap(); + + // Name the module? - `helix/commands.scm` + engine.register_steel_module( + "helix/static.scm".to_string(), + builtin_static_command_module, + ); } if generate_sources { @@ -2245,6 +2251,7 @@ fn register_hook(event_kind: String, callback_fn: SteelVal) -> steel::UnRecovera } fn configure_lsp_globals() { + use std::fmt::Write; if let Ok(steel_lsp_home) = std::env::var("STEEL_LSP_HOME") { let mut path = PathBuf::from(steel_lsp_home); path.push("_helix-global-builtins.scm"); @@ -2270,15 +2277,32 @@ fn configure_lsp_globals() { ]; for value in names { - use std::fmt::Write; writeln!(&mut output, "(#%register-global '{})", value).unwrap(); } + writeln!(&mut output, "").unwrap(); + writeln!( + &mut output, + "(#%register-additional-search-path \"{}\")", + helix_loader::config_dir().to_str().unwrap() + ) + .unwrap(); + + for dir in helix_loader::runtime_dirs() { + writeln!( + &mut output, + "(#%register-additional-search-path \"{}\")", + dir.to_str().unwrap() + ) + .unwrap(); + } + std::fs::write(path, output).unwrap(); } } fn configure_lsp_builtins(name: &str, module: &BuiltInModule) { + use std::fmt::Write; if let Ok(steel_lsp_home) = std::env::var("STEEL_LSP_HOME") { let mut path = PathBuf::from(steel_lsp_home); path.push(&format!("_helix-{}-builtins.scm", name)); @@ -2298,7 +2322,6 @@ fn configure_lsp_builtins(name: &str, module: &BuiltInModule) { output.push_str(&format!(r#"(register-values #%helix-{}-module '("#, name)); for value in module.names() { - use std::fmt::Write; writeln!(&mut output, "{}", value).unwrap(); } @@ -2523,6 +2546,7 @@ pub fn helix_runtime_search_path() -> PathBuf { helix_loader::config_dir().join("helix") } +// Embed them in the binary... first pub fn configure_builtin_sources(engine: &mut Engine, generate_sources: bool) { load_editor_api(engine, generate_sources); load_theme_api(engine, generate_sources); @@ -2547,8 +2571,13 @@ pub fn configure_builtin_sources(engine: &mut Engine, generate_sources: bool) { fn configure_engine_impl(mut engine: Engine) -> Engine { log::info!("Loading engine!"); + // Engine: Add search directories. engine.add_search_directory(helix_loader::config_dir()); + for dir in helix_loader::runtime_dirs() { + engine.add_search_directory(dir.to_owned()); + } + engine.register_value("*helix.cx*", SteelVal::Void); engine.register_value("*helix.config*", SteelVal::Void); engine.register_value( From 82ad9c1f973a3966c3b2ca8a329a2eeeae0361df Mon Sep 17 00:00:00 2001 From: Matt Paras Date: Sun, 27 Apr 2025 07:48:59 -0500 Subject: [PATCH 2/4] update steel --- Cargo.lock | 207 ++++++++--------------------------------------------- steel | 2 +- 2 files changed, 29 insertions(+), 180 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7dd3fc127..23e04ee0b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -165,7 +165,7 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -523,27 +523,6 @@ dependencies = [ "parking_lot_core", ] -[[package]] -name = "dirs" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" -dependencies = [ - "libc", - "option-ext", - "redox_users", - "windows-sys 0.48.0", -] - [[package]] name = "displaydoc" version = "0.2.5" @@ -1899,17 +1878,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "http" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - [[package]] name = "httparse" version = "1.10.1" @@ -2298,7 +2266,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -2429,20 +2397,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "num" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - [[package]] name = "num-bigint" version = "0.4.6" @@ -2454,16 +2408,6 @@ dependencies = [ "serde", ] -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", - "serde", -] - [[package]] name = "num-integer" version = "0.1.46" @@ -2473,17 +2417,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-rational" version = "0.4.2" @@ -2493,7 +2426,6 @@ dependencies = [ "num-bigint", "num-integer", "num-traits", - "serde", ] [[package]] @@ -2541,12 +2473,6 @@ dependencies = [ "pathdiff", ] -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - [[package]] name = "parking_lot" version = "0.12.3" @@ -2567,7 +2493,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -2815,17 +2741,6 @@ dependencies = [ "bitflags", ] -[[package]] -name = "redox_users" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" -dependencies = [ - "getrandom 0.2.15", - "libredox", - "thiserror 1.0.69", -] - [[package]] name = "regex" version = "1.11.1" @@ -3151,7 +3066,7 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "steel-core" version = "0.6.0" -source = "git+https://github.com/mattwparas/steel.git#2f28ab10523198726d343257d29d892864e897b0" +source = "git+https://github.com/mattwparas/steel.git#7ab6cc8033be6312ae6d1b702dfa18b1463251c0" dependencies = [ "abi_stable", "anyhow", @@ -3162,31 +3077,31 @@ dependencies = [ "chrono", "codespan-reporting", "compact_str", - "crossbeam", - "dirs", + "crossbeam-channel", + "crossbeam-utils", + "env_home", "futures-executor", "futures-task", "futures-util", "fxhash", "getrandom 0.3.2", - "home", - "http", "httparse", "im", "im-lists", "im-rc", "lasso", "log", - "num", + "num-bigint", + "num-integer", + "num-rational", + "num-traits", "once_cell", "parking_lot", "polling", - "pretty", "quickscope", "radix_fmt", "rand 0.9.0", "serde", - "serde_derive", "serde_json", "smallvec", "stacker", @@ -3202,7 +3117,7 @@ dependencies = [ [[package]] name = "steel-derive" version = "0.5.0" -source = "git+https://github.com/mattwparas/steel.git#2f28ab10523198726d343257d29d892864e897b0" +source = "git+https://github.com/mattwparas/steel.git#7ab6cc8033be6312ae6d1b702dfa18b1463251c0" dependencies = [ "proc-macro2", "quote", @@ -3212,7 +3127,7 @@ dependencies = [ [[package]] name = "steel-doc" version = "0.6.0" -source = "git+https://github.com/mattwparas/steel.git#2f28ab10523198726d343257d29d892864e897b0" +source = "git+https://github.com/mattwparas/steel.git#7ab6cc8033be6312ae6d1b702dfa18b1463251c0" dependencies = [ "steel-core", ] @@ -3220,26 +3135,26 @@ dependencies = [ [[package]] name = "steel-gen" version = "0.2.0" -source = "git+https://github.com/mattwparas/steel.git#2f28ab10523198726d343257d29d892864e897b0" +source = "git+https://github.com/mattwparas/steel.git#7ab6cc8033be6312ae6d1b702dfa18b1463251c0" dependencies = [ "codegen", "serde", - "serde_derive", ] [[package]] name = "steel-parser" version = "0.6.0" -source = "git+https://github.com/mattwparas/steel.git#2f28ab10523198726d343257d29d892864e897b0" +source = "git+https://github.com/mattwparas/steel.git#7ab6cc8033be6312ae6d1b702dfa18b1463251c0" dependencies = [ "compact_str", "fxhash", "lasso", - "num", + "num-bigint", + "num-rational", + "num-traits", "once_cell", "pretty", "serde", - "serde_derive", "smallvec", ] @@ -3778,7 +3693,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -3787,22 +3702,13 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -3811,22 +3717,7 @@ version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-targets", ] [[package]] @@ -3835,46 +3726,28 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -3887,48 +3760,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" diff --git a/steel b/steel index 2f28ab105..7ab6cc803 160000 --- a/steel +++ b/steel @@ -1 +1 @@ -Subproject commit 2f28ab10523198726d343257d29d892864e897b0 +Subproject commit 7ab6cc8033be6312ae6d1b702dfa18b1463251c0 From e684c7db1b3bee4c0592d6a46900ec98b2f53e2a Mon Sep 17 00:00:00 2001 From: Matt Paras Date: Sun, 27 Apr 2025 11:39:38 -0500 Subject: [PATCH 3/4] setup embedding --- helix-term/src/commands/engine/steel.rs | 26 ++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/helix-term/src/commands/engine/steel.rs b/helix-term/src/commands/engine/steel.rs index b3f1ef78b..3f8cb74d8 100644 --- a/helix-term/src/commands/engine/steel.rs +++ b/helix-term/src/commands/engine/steel.rs @@ -425,7 +425,6 @@ fn load_static_commands(engine: &mut Engine, generate_sources: bool) { std::fs::write(target_directory, &builtin_static_command_module).unwrap(); - // Name the module? - `helix/commands.scm` engine.register_steel_module( "helix/static.scm".to_string(), builtin_static_command_module, @@ -508,7 +507,12 @@ fn load_typed_commands(engine: &mut Engine, generate_sources: bool) { target_directory.push("commands.scm"); - std::fs::write(target_directory, builtin_typable_command_module).unwrap(); + std::fs::write(target_directory, &builtin_typable_command_module).unwrap(); + + engine.register_steel_module( + "helix/commands.scm".to_string(), + builtin_typable_command_module, + ); } if generate_sources { @@ -897,7 +901,12 @@ fn load_configuration_api(engine: &mut Engine, generate_sources: bool) { target_directory.push("configuration.scm"); - std::fs::write(target_directory, builtin_configuration_module).unwrap(); + std::fs::write(target_directory, &builtin_configuration_module).unwrap(); + + engine.register_steel_module( + "helix/configuration.scm".to_string(), + builtin_configuration_module, + ); } if generate_sources { @@ -1113,7 +1122,12 @@ fn load_editor_api(engine: &mut Engine, generate_sources: bool) { target_directory.push("editor.scm"); - std::fs::write(target_directory, builtin_editor_command_module).unwrap(); + std::fs::write(target_directory, &builtin_editor_command_module).unwrap(); + + engine.register_steel_module( + "helix/editor.scm".to_string(), + builtin_editor_command_module, + ); } // Generate the lsp configuration @@ -2532,7 +2546,9 @@ fn load_misc_api(engine: &mut Engine, generate_sources: bool) { target_directory.push("misc.scm"); - std::fs::write(target_directory, builtin_misc_module).unwrap(); + std::fs::write(target_directory, &builtin_misc_module).unwrap(); + + engine.register_steel_module("helix/misc.scm".to_string(), builtin_misc_module); } if generate_sources { From 5c6620b46568b47958981f44495bd0687d6d4d77 Mon Sep 17 00:00:00 2001 From: Matt Paras Date: Sun, 27 Apr 2025 11:42:15 -0500 Subject: [PATCH 4/4] remove debug prints --- helix-term/src/commands/engine.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/helix-term/src/commands/engine.rs b/helix-term/src/commands/engine.rs index f557fc829..6a5abbfd4 100644 --- a/helix-term/src/commands/engine.rs +++ b/helix-term/src/commands/engine.rs @@ -141,11 +141,9 @@ impl ScriptingEngine { } pub fn generate_sources() { - let now = std::time::Instant::now(); for kind in PLUGIN_PRECEDENCE { manual_dispatch!(kind, generate_sources()) } - println!("Time taken: {:?}", now.elapsed()); } }