mirror of https://github.com/helix-editor/helix
add new xtask for code generation of core libraries
parent
38f344c21c
commit
eb20adbaad
|
@ -1488,9 +1488,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "im-lists"
|
||||
version = "0.7.1"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0c07eff2c41645923382085ea8627509e5184f7a668f75d0c1e16091f7af4798"
|
||||
checksum = "3e7233fb8b1ffc0b1d6033fd311a74a0443164628c62abbc871185ee95098b63"
|
||||
dependencies = [
|
||||
"smallvec",
|
||||
]
|
||||
|
@ -1742,6 +1742,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214"
|
||||
dependencies = [
|
||||
"num-traits",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1775,6 +1776,7 @@ dependencies = [
|
|||
"num-bigint",
|
||||
"num-integer",
|
||||
"num-traits",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2307,7 +2309,7 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
|||
[[package]]
|
||||
name = "steel-core"
|
||||
version = "0.6.0"
|
||||
source = "git+https://github.com/mattwparas/steel.git#ad307d9ab163b99ac6dc0bc06a04601042a3f325"
|
||||
source = "git+https://github.com/mattwparas/steel.git#1fb88e561474c723a4fd2675553d6091a380aef1"
|
||||
dependencies = [
|
||||
"abi_stable",
|
||||
"anyhow",
|
||||
|
@ -2335,6 +2337,7 @@ dependencies = [
|
|||
"steel-derive",
|
||||
"steel-gen",
|
||||
"steel-parser",
|
||||
"strsim",
|
||||
"weak-table",
|
||||
"which 4.4.2",
|
||||
]
|
||||
|
@ -2342,7 +2345,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "steel-derive"
|
||||
version = "0.5.0"
|
||||
source = "git+https://github.com/mattwparas/steel.git#ad307d9ab163b99ac6dc0bc06a04601042a3f325"
|
||||
source = "git+https://github.com/mattwparas/steel.git#1fb88e561474c723a4fd2675553d6091a380aef1"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -2352,7 +2355,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "steel-gen"
|
||||
version = "0.2.0"
|
||||
source = "git+https://github.com/mattwparas/steel.git#ad307d9ab163b99ac6dc0bc06a04601042a3f325"
|
||||
source = "git+https://github.com/mattwparas/steel.git#1fb88e561474c723a4fd2675553d6091a380aef1"
|
||||
dependencies = [
|
||||
"codegen",
|
||||
"serde",
|
||||
|
@ -2362,15 +2365,16 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "steel-parser"
|
||||
version = "0.6.0"
|
||||
source = "git+https://github.com/mattwparas/steel.git#ad307d9ab163b99ac6dc0bc06a04601042a3f325"
|
||||
source = "git+https://github.com/mattwparas/steel.git#1fb88e561474c723a4fd2675553d6091a380aef1"
|
||||
dependencies = [
|
||||
"fxhash",
|
||||
"lasso",
|
||||
"num-bigint",
|
||||
"num",
|
||||
"once_cell",
|
||||
"pretty",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"smallvec",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2379,6 +2383,12 @@ version = "0.4.3"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e9557cb6521e8d009c51a8666f09356f4b817ba9ba0981a305bd86aee47bd35c"
|
||||
|
||||
[[package]]
|
||||
name = "strsim"
|
||||
version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01"
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.109"
|
||||
|
|
|
@ -81,7 +81,6 @@ use ignore::{DirEntry, WalkBuilder, WalkState};
|
|||
|
||||
pub type OnKeyCallback = Box<dyn FnOnce(&mut Context, KeyEvent)>;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct Context<'a> {
|
||||
pub register: Option<char>,
|
||||
pub count: Option<NonZeroUsize>,
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
use arc_swap::ArcSwapAny;
|
||||
use helix_core::syntax::Configuration;
|
||||
use helix_view::{document::Mode, input::KeyEvent, Theme};
|
||||
use helix_view::{document::Mode, input::KeyEvent};
|
||||
|
||||
use std::{borrow::Cow, sync::Arc};
|
||||
|
||||
|
@ -11,7 +10,7 @@ use crate::{
|
|||
ui::{self, PromptEvent},
|
||||
};
|
||||
|
||||
use super::{shell_impl, Context, MappableCommand, TYPABLE_COMMAND_LIST};
|
||||
use super::{Context, MappableCommand, TYPABLE_COMMAND_LIST};
|
||||
|
||||
#[cfg(feature = "steel")]
|
||||
mod components;
|
||||
|
@ -138,6 +137,12 @@ impl ScriptingEngine {
|
|||
.flat_map(|kind| manual_dispatch!(kind, available_commands()))
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn generate_sources() {
|
||||
for kind in PLUGIN_PRECEDENCE {
|
||||
manual_dispatch!(kind, generate_sources())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl PluginSystem for NoEngine {
|
||||
|
@ -215,4 +220,6 @@ pub trait PluginSystem {
|
|||
fn available_commands<'a>(&self) -> Vec<Cow<'a, str>> {
|
||||
Vec::new()
|
||||
}
|
||||
|
||||
fn generate_sources(&self) {}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,5 @@
|
|||
use helix_term::commands::ScriptingEngine;
|
||||
|
||||
pub fn code_gen() {
|
||||
ScriptingEngine::generate_sources()
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
mod codegen;
|
||||
mod docgen;
|
||||
mod helpers;
|
||||
mod path;
|
||||
|
@ -9,6 +10,7 @@ use std::{env, error::Error};
|
|||
type DynError = Box<dyn Error>;
|
||||
|
||||
pub mod tasks {
|
||||
use crate::codegen::code_gen;
|
||||
use crate::docgen::{lang_features, typable_commands, write};
|
||||
use crate::docgen::{LANG_SUPPORT_MD_OUTPUT, TYPABLE_COMMANDS_MD_OUTPUT};
|
||||
use crate::querycheck::query_check;
|
||||
|
@ -32,6 +34,10 @@ pub mod tasks {
|
|||
query_check()
|
||||
}
|
||||
|
||||
pub fn codegen() {
|
||||
code_gen()
|
||||
}
|
||||
|
||||
pub fn print_help() {
|
||||
println!(
|
||||
"
|
||||
|
@ -54,6 +60,7 @@ fn main() -> Result<(), DynError> {
|
|||
"docgen" => tasks::docgen()?,
|
||||
"themelint" => tasks::themelint(env::args().nth(2))?,
|
||||
"query-check" => tasks::querycheck()?,
|
||||
"code-gen" => tasks::codegen(),
|
||||
invalid => return Err(format!("Invalid task name: {}", invalid).into()),
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue