aboutsummaryrefslogtreecommitdiff
path: root/helix-syntax
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-03-25 06:26:25 +0000
committerBlaž Hrastnik2021-03-25 06:26:25 +0000
commite3c4edae32f6d70bf20655c7c25b3cdf39f3f281 (patch)
tree5351a5a797de5f213b87f25ae4ba049c8e74d11b /helix-syntax
parenta900159a863c24e4afb1485d8dcff760f722f36b (diff)
Add the machinery to load syntax config from TOML.
It's embedded into the binary at build time for now, but it's progress.
Diffstat (limited to 'helix-syntax')
-rw-r--r--helix-syntax/Cargo.toml1
-rw-r--r--helix-syntax/languages.toml5
-rw-r--r--helix-syntax/src/lib.rs4
3 files changed, 4 insertions, 6 deletions
diff --git a/helix-syntax/Cargo.toml b/helix-syntax/Cargo.toml
index c50e3091..f145b6c0 100644
--- a/helix-syntax/Cargo.toml
+++ b/helix-syntax/Cargo.toml
@@ -8,6 +8,7 @@ edition = "2018"
[dependencies]
tree-sitter = "0.17"
+serde = { version = "1.0", features = ["derive"] }
[build-dependencies]
cc = { version = "1", features = ["parallel"] }
diff --git a/helix-syntax/languages.toml b/helix-syntax/languages.toml
deleted file mode 100644
index dc4fcf6f..00000000
--- a/helix-syntax/languages.toml
+++ /dev/null
@@ -1,5 +0,0 @@
-[[language]]
-name = "rust"
-scope = "source.rust"
-injection-regex = "rust"
-file-types = ["rs"]
diff --git a/helix-syntax/src/lib.rs b/helix-syntax/src/lib.rs
index 64fe1023..5d3e0d99 100644
--- a/helix-syntax/src/lib.rs
+++ b/helix-syntax/src/lib.rs
@@ -1,3 +1,4 @@
+use serde::{Deserialize, Serialize};
use tree_sitter::Language;
#[macro_export]
@@ -12,7 +13,8 @@ macro_rules! mk_extern {
#[macro_export]
macro_rules! mk_enum {
( $( $camel:ident ),* ) => {
- #[derive(Clone, Copy, Debug, PartialEq)]
+ #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
+ #[serde(rename_all = "lowercase")]
pub enum Lang {
$(
$camel,