feat: Use custom version of tree-sitter-rust
Not much development is happening in that plugin.
This commit is contained in:
parent
c97e22fedb
commit
fe69041113
5 changed files with 12 additions and 5 deletions
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
[submodule "tree-sitter-rust"]
|
||||
path = tree-sitter-rust
|
||||
url = git@github.com:sclu1034/tree-sitter-rust.git
|
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -1086,8 +1086,6 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "tree-sitter-rust"
|
||||
version = "0.20.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "797842733e252dc11ae5d403a18060bf337b822fc2ae5ddfaa6ff4d9cc20bda6"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"tree-sitter",
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
[package]
|
||||
name = "kak-highlight"
|
||||
author = "Lucas Schwiderski"
|
||||
description = "Tree-sitter-based highlighting for Kakoune"
|
||||
version = "1.0.0"
|
||||
edition = "2021"
|
||||
|
@ -19,7 +18,7 @@ tracing-error = "0.2.0"
|
|||
tracing-subscriber = { version = "0.3.16", features = ["env-filter"] }
|
||||
tree-sitter = "0.20.10"
|
||||
tree-sitter-highlight = "0.20.1"
|
||||
tree-sitter-rust = "0.20.3"
|
||||
tree-sitter-rust = { path = "./tree-sitter-rust", version = "*" }
|
||||
|
||||
[dev-dependencies]
|
||||
criterion = "0.4.0"
|
||||
|
|
|
@ -241,7 +241,13 @@ pub fn highlight_content(
|
|||
}
|
||||
|
||||
let highlights = highlighter
|
||||
.highlight(highlight_config, content, None, |_| None)
|
||||
.highlight(highlight_config, content, None, |lang| {
|
||||
if lang == "rust" {
|
||||
Some(highlight_config)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.wrap_err("Failed to highlight content")?;
|
||||
|
||||
let mut stack = VecDeque::with_capacity(64);
|
||||
|
|
1
tree-sitter-rust
Submodule
1
tree-sitter-rust
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 5dcc1e3df8cdce5365b65dac4692e350a2c396e5
|
Loading…
Add table
Reference in a new issue