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