Add agda, nix
This commit is contained in:
parent
d62b1657c3
commit
0acc4dbba4
|
@ -65,4 +65,5 @@ ruby = []
|
|||
rust = []
|
||||
scala = []
|
||||
typescript = []
|
||||
|
||||
nix = []
|
||||
agda = []
|
||||
|
|
4
build.rs
4
build.rs
|
@ -45,6 +45,10 @@ fn main() {
|
|||
"scala",
|
||||
#[cfg(feature = "typescript")]
|
||||
"typescript",
|
||||
#[cfg(feature = "nix")]
|
||||
"nix",
|
||||
#[cfg(feature = "agda")]
|
||||
"agda",
|
||||
] {
|
||||
println!("cargo:rustc-link-lib=static=tree-sitter-{lang}");
|
||||
}
|
||||
|
|
|
@ -22,14 +22,14 @@
|
|||
};
|
||||
sitters = tree-sitters.packages.${sys};
|
||||
sitterlist = [
|
||||
sitters.agda sitters.bash sitters.c sitters.nix sitters.python sitters.rust
|
||||
sitters.bash sitters.c sitters.python sitters.rust sitters.nix sitters.agda
|
||||
];
|
||||
|
||||
kak-tree-bin = platform.buildRustPackage {
|
||||
name = "kak-tree-bin";
|
||||
src = ./.;
|
||||
cargoLock = { lockFile = ./Cargo.lock; };
|
||||
buildFeatures = ["bash" "c" "python" "rust"]; # TODO: Add agda, nix
|
||||
buildFeatures = ["bash" "c" "python" "rust" "nix" "agda"];
|
||||
inherit sitterlist;
|
||||
preBuild = ''
|
||||
mkdir lib
|
||||
|
|
|
@ -45,6 +45,10 @@ extern "C" {
|
|||
fn tree_sitter_scala() -> Language;
|
||||
#[cfg(feature = "typescript")]
|
||||
fn tree_sitter_typescript() -> Language;
|
||||
#[cfg(feature = "nix")]
|
||||
fn tree_sitter_nix() -> Language;
|
||||
#[cfg(feature = "agda")]
|
||||
fn tree_sitter_agda() -> Language;
|
||||
}
|
||||
|
||||
pub fn filetype_to_language(filetype: &str) -> Option<Language> {
|
||||
|
@ -93,6 +97,10 @@ pub fn filetype_to_language(filetype: &str) -> Option<Language> {
|
|||
"scala" => tree_sitter_scala,
|
||||
#[cfg(feature = "typescript")]
|
||||
"typescript" => tree_sitter_typescript,
|
||||
#[cfg(feature = "nix")]
|
||||
"nix" => tree_sitter_nix,
|
||||
#[cfg(feature = "agda")]
|
||||
"agda" => tree_sitter_agda,
|
||||
_ => return None,
|
||||
};
|
||||
Some(unsafe { sitter() })
|
||||
|
|
Loading…
Reference in New Issue
Block a user