cli: Update tree-sitter

Bump `tree-sitter` from 0.20 to 0.24 and replace `tree-sitter-toml` with
the fork `tree-sitter-toml-ng`.
This commit is contained in:
Lorenz Leutgeb 2024-11-29 16:09:53 +01:00
parent fd892d006f
commit 1fa1cafee9
No known key found for this signature in database
3 changed files with 133 additions and 103 deletions

153
Cargo.lock generated
View File

@ -313,13 +313,13 @@ dependencies = [
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.0.95" version = "1.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc"
dependencies = [ dependencies = [
"jobserver", "jobserver",
"libc", "libc",
"once_cell", "shlex",
] ]
[[package]] [[package]]
@ -1351,9 +1351,9 @@ dependencies = [
[[package]] [[package]]
name = "lazy_static" name = "lazy_static"
version = "1.4.0" version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
dependencies = [ dependencies = [
"spin", "spin",
] ]
@ -1450,7 +1450,7 @@ checksum = "5cf92c10c7e361d6b99666ec1c6f9805b0bea2c3bd8c78dc6fe98ac5bd78db11"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.60", "syn 2.0.89",
] ]
[[package]] [[package]]
@ -1825,9 +1825,9 @@ dependencies = [
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.81" version = "1.0.92"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
@ -1939,7 +1939,7 @@ dependencies = [
"tree-sitter-python", "tree-sitter-python",
"tree-sitter-ruby", "tree-sitter-ruby",
"tree-sitter-rust", "tree-sitter-rust",
"tree-sitter-toml", "tree-sitter-toml-ng",
"tree-sitter-typescript", "tree-sitter-typescript",
"zeroize", "zeroize",
] ]
@ -2231,9 +2231,9 @@ checksum = "20145670ba436b55d91fc92d25e71160fbfbdd57831631c8d7d36377a476f1cb"
[[package]] [[package]]
name = "regex" name = "regex"
version = "1.10.4" version = "1.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
dependencies = [ dependencies = [
"aho-corasick", "aho-corasick",
"memchr", "memchr",
@ -2243,9 +2243,9 @@ dependencies = [
[[package]] [[package]]
name = "regex-automata" name = "regex-automata"
version = "0.4.6" version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
dependencies = [ dependencies = [
"aho-corasick", "aho-corasick",
"memchr", "memchr",
@ -2254,9 +2254,9 @@ dependencies = [
[[package]] [[package]]
name = "regex-syntax" name = "regex-syntax"
version = "0.8.3" version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
[[package]] [[package]]
name = "rfc6979" name = "rfc6979"
@ -2374,7 +2374,7 @@ checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.60", "syn 2.0.89",
] ]
[[package]] [[package]]
@ -2512,9 +2512,9 @@ dependencies = [
[[package]] [[package]]
name = "spin" name = "spin"
version = "0.5.2" version = "0.9.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
[[package]] [[package]]
name = "spki" name = "spki"
@ -2605,6 +2605,12 @@ dependencies = [
"zeroize", "zeroize",
] ]
[[package]]
name = "streaming-iterator"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b2231b7c3057d5e4ad0156fb3dc807d900806020c5ffa3ee6ff2c8c76fb8520"
[[package]] [[package]]
name = "subtle" name = "subtle"
version = "2.5.0" version = "2.5.0"
@ -2624,9 +2630,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.60" version = "2.0.89"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -2682,22 +2688,22 @@ dependencies = [
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "1.0.59" version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl",
] ]
[[package]] [[package]]
name = "thiserror-impl" name = "thiserror-impl"
version = "1.0.59" version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.60", "syn 2.0.89",
] ]
[[package]] [[package]]
@ -2756,130 +2762,141 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]] [[package]]
name = "tree-sitter" name = "tree-sitter"
version = "0.20.10" version = "0.24.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e747b1f9b7b931ed39a548c1fae149101497de3c1fc8d9e18c62c1a66c683d3d" checksum = "b67baf55e7e1b6806063b1e51041069c90afff16afcbbccd278d899f9d84bca4"
dependencies = [ dependencies = [
"cc", "cc",
"regex", "regex",
"regex-syntax",
"streaming-iterator",
"tree-sitter-language",
] ]
[[package]] [[package]]
name = "tree-sitter-bash" name = "tree-sitter-bash"
version = "0.20.5" version = "0.23.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57da2032c37eb2ce29fd18df7d3b94355fec8d6d854d8f80934955df542b5906" checksum = "329a4d48623ac337d42b1df84e81a1c9dbb2946907c102ca72db158c1964a52e"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter-language",
] ]
[[package]] [[package]]
name = "tree-sitter-c" name = "tree-sitter-c"
version = "0.20.8" version = "0.23.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4bbd5f3d8658c08581f8f2adac6c391c2e9fa00fe9246bf6c5f52213b9cc6b72" checksum = "db56fadd8c3c6bc880dffcf1177c9d1c54a71a5207716db8660189082e63b587"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter-language",
] ]
[[package]] [[package]]
name = "tree-sitter-css" name = "tree-sitter-css"
version = "0.20.0" version = "0.23.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3306ddefa1d2681adda2613d11974ffabfbeb215e23235da6c862f3493a04fd" checksum = "25435a275adb3226b6fddab891bbc50d1a500774a44ceb97022a39666ccda75d"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter-language",
] ]
[[package]] [[package]]
name = "tree-sitter-go" name = "tree-sitter-go"
version = "0.20.0" version = "0.23.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ad6d11f19441b961af2fda7f12f5d0dac325f6d6de83836a1d3750018cc5114" checksum = "b13d476345220dbe600147dd444165c5791bf85ef53e28acbedd46112ee18431"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter-language",
] ]
[[package]] [[package]]
name = "tree-sitter-highlight" name = "tree-sitter-highlight"
version = "0.20.1" version = "0.24.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "042342584c5a7a0b833d9fc4e2bdab3f9868ddc6c4b339a1e01451c6720868bc" checksum = "7f0f856de10d70a6d14d66db3648f7410c131cd49e989a863f15dda9acae6044"
dependencies = [ dependencies = [
"lazy_static",
"regex", "regex",
"streaming-iterator",
"thiserror", "thiserror",
"tree-sitter", "tree-sitter",
] ]
[[package]] [[package]]
name = "tree-sitter-html" name = "tree-sitter-html"
version = "0.20.0" version = "0.23.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "017822b6bd42843c4bd67fabb834f61ce23254e866282dd93871350fd6b7fa1d" checksum = "261b708e5d92061ede329babaaa427b819329a9d427a1d710abb0f67bbef63ee"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter-language",
] ]
[[package]] [[package]]
name = "tree-sitter-json" name = "tree-sitter-json"
version = "0.20.2" version = "0.24.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a9a38a9c679b55cc8d17350381ec08d69fa1a17a53fcf197f344516e485ed4d" checksum = "4d727acca406c0020cffc6cf35516764f36c8e3dc4408e5ebe2cb35a947ec471"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter-language",
] ]
[[package]] [[package]]
name = "tree-sitter-md" name = "tree-sitter-language"
version = "0.1.7" version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c20d3ef8d202430b644a307e6299d84bf8ed87fa1b796e4638f8805a595060c" checksum = "e8ddffe35a0e5eeeadf13ff7350af564c6e73993a24db62caee1822b185c2600"
[[package]]
name = "tree-sitter-md"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17f968c22a01010b83fc960455ae729db08dbeb6388617d9113897cb9204b030"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter-language",
] ]
[[package]] [[package]]
name = "tree-sitter-python" name = "tree-sitter-python"
version = "0.20.4" version = "0.23.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6c93b1b1fbd0d399db3445f51fd3058e43d0b4dcff62ddbdb46e66550978aa5" checksum = "2416de7eea3f2e1bd53c250f2d3f3394fc77f78497680f37f4b87918b8d752e3"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter-language",
] ]
[[package]] [[package]]
name = "tree-sitter-ruby" name = "tree-sitter-ruby"
version = "0.20.1" version = "0.23.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44d50ef383469df8485f024c5fb01faced8cb90368192a7ba02605b43b2427fe" checksum = "be0484ea4ef6bb9c575b4fdabde7e31340a8d2dbc7d52b321ac83da703249f95"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter-language",
] ]
[[package]] [[package]]
name = "tree-sitter-rust" name = "tree-sitter-rust"
version = "0.20.4" version = "0.23.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0832309b0b2b6d33760ce5c0e818cb47e1d72b468516bfe4134408926fa7594" checksum = "a4d64d449ca63e683c562c7743946a646671ca23947b9c925c0cfbe65051a4af"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter-language",
] ]
[[package]] [[package]]
name = "tree-sitter-toml" name = "tree-sitter-toml-ng"
version = "0.20.0" version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca517f578a98b23d20780247cc2688407fa81effad5b627a5a364ec3339b53e8" checksum = "695d20cd83acf16c02c773f03e76d7b43b19883d4e2ce3652a8f06b5e0da7455"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter",
@ -2887,12 +2904,12 @@ dependencies = [
[[package]] [[package]]
name = "tree-sitter-typescript" name = "tree-sitter-typescript"
version = "0.20.5" version = "0.23.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8bc1d2c24276a48ef097a71b56888ac9db63717e8f8d0b324668a27fd619670" checksum = "6c5f76ed8d947a75cc446d5fccd8b602ebf0cde64ccf2ffa434d873d7a575eff"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter-language",
] ]
[[package]] [[package]]
@ -3019,7 +3036,7 @@ dependencies = [
"once_cell", "once_cell",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.60", "syn 2.0.89",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@ -3041,7 +3058,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.60", "syn 2.0.89",
"wasm-bindgen-backend", "wasm-bindgen-backend",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]

View File

@ -30,20 +30,20 @@ shlex = { version = "1.1.0" }
tempfile = { version = "3.3.0" } tempfile = { version = "3.3.0" }
thiserror = { version = "1" } thiserror = { version = "1" }
timeago = { version = "0.4.2", default-features = false } timeago = { version = "0.4.2", default-features = false }
tree-sitter = { version = "0.20.0" } tree-sitter = { version = "0.24.4" }
tree-sitter-highlight = { version = "0.20" } tree-sitter-highlight = { version = "0.24.4" }
tree-sitter-json = { version = "0.20.1" } tree-sitter-json = { version = "0.24.8" }
tree-sitter-rust = { version = "0.20" } tree-sitter-rust = { version = "0.23.2" }
tree-sitter-typescript = { version = "0.20.3" } tree-sitter-typescript = { version = "0.23.2" }
tree-sitter-html = { version = "0.20" } tree-sitter-html = { version = "0.23.2" }
tree-sitter-css = { version = "0.20" } tree-sitter-css = { version = "0.23.1" }
tree-sitter-toml = { version = "0.20" } tree-sitter-toml-ng = { version = "0.6.0" }
tree-sitter-c = { version = "0.20" } tree-sitter-c = { version = "0.23.2" }
tree-sitter-python = { version = "0.20" } tree-sitter-python = { version = "0.23.4" }
tree-sitter-ruby = { version = "0.20" } tree-sitter-ruby = { version = "0.23.1" }
tree-sitter-bash = { version = "0.20" } tree-sitter-bash = { version = "0.23.3" }
tree-sitter-go = { version = "0.20.0" } tree-sitter-go = { version = "0.23.4" }
tree-sitter-md = { version = "0.1.5" } tree-sitter-md = { version = "0.3.2" }
zeroize = { version = "1.1" } zeroize = { version = "1.1" }
[dependencies.radicle] [dependencies.radicle]

View File

@ -220,17 +220,19 @@ impl Highlighter {
match language { match language {
"rust" => Some(self.configs.entry(language).or_insert_with(|| { "rust" => Some(self.configs.entry(language).or_insert_with(|| {
ts::HighlightConfiguration::new( ts::HighlightConfiguration::new(
tree_sitter_rust::language(), tree_sitter_rust::LANGUAGE.into(),
tree_sitter_rust::HIGHLIGHT_QUERY, tree_sitter_rust::HIGHLIGHTS_QUERY,
tree_sitter_rust::INJECTIONS_QUERY, tree_sitter_rust::INJECTIONS_QUERY,
"", "",
"",
) )
.expect("Highlighter::config: highlight configuration must be valid") .expect("Highlighter::config: highlight configuration must be valid")
})), })),
"json" => Some(self.configs.entry(language).or_insert_with(|| { "json" => Some(self.configs.entry(language).or_insert_with(|| {
ts::HighlightConfiguration::new( ts::HighlightConfiguration::new(
tree_sitter_json::language(), tree_sitter_json::LANGUAGE.into(),
tree_sitter_json::HIGHLIGHT_QUERY, tree_sitter_json::HIGHLIGHTS_QUERY,
"",
"", "",
"", "",
) )
@ -238,35 +240,39 @@ impl Highlighter {
})), })),
"typescript" => Some(self.configs.entry(language).or_insert_with(|| { "typescript" => Some(self.configs.entry(language).or_insert_with(|| {
ts::HighlightConfiguration::new( ts::HighlightConfiguration::new(
tree_sitter_typescript::language_typescript(), tree_sitter_typescript::LANGUAGE_TYPESCRIPT.into(),
tree_sitter_typescript::HIGHLIGHT_QUERY, tree_sitter_typescript::HIGHLIGHTS_QUERY,
"", "",
tree_sitter_typescript::LOCALS_QUERY, tree_sitter_typescript::LOCALS_QUERY,
"",
) )
.expect("Highlighter::config: highlight configuration must be valid") .expect("Highlighter::config: highlight configuration must be valid")
})), })),
"markdown" => Some(self.configs.entry(language).or_insert_with(|| { "markdown" => Some(self.configs.entry(language).or_insert_with(|| {
ts::HighlightConfiguration::new( ts::HighlightConfiguration::new(
tree_sitter_md::language(), tree_sitter_md::LANGUAGE.into(),
tree_sitter_md::HIGHLIGHT_QUERY_BLOCK, tree_sitter_md::HIGHLIGHT_QUERY_BLOCK,
tree_sitter_md::INJECTION_QUERY_BLOCK, tree_sitter_md::INJECTION_QUERY_BLOCK,
"", "",
"",
) )
.expect("Highlighter::config: highlight configuration must be valid") .expect("Highlighter::config: highlight configuration must be valid")
})), })),
"css" => Some(self.configs.entry(language).or_insert_with(|| { "css" => Some(self.configs.entry(language).or_insert_with(|| {
ts::HighlightConfiguration::new( ts::HighlightConfiguration::new(
tree_sitter_css::language(), tree_sitter_css::LANGUAGE.into(),
tree_sitter_css::HIGHLIGHTS_QUERY, tree_sitter_css::HIGHLIGHTS_QUERY,
"", "",
"", "",
"",
) )
.expect("Highlighter::config: highlight configuration must be valid") .expect("Highlighter::config: highlight configuration must be valid")
})), })),
"go" => Some(self.configs.entry(language).or_insert_with(|| { "go" => Some(self.configs.entry(language).or_insert_with(|| {
ts::HighlightConfiguration::new( ts::HighlightConfiguration::new(
tree_sitter_go::language(), tree_sitter_go::LANGUAGE.into(),
tree_sitter_go::HIGHLIGHT_QUERY, tree_sitter_go::HIGHLIGHTS_QUERY,
"",
"", "",
"", "",
) )
@ -274,26 +280,29 @@ impl Highlighter {
})), })),
"shell" => Some(self.configs.entry(language).or_insert_with(|| { "shell" => Some(self.configs.entry(language).or_insert_with(|| {
ts::HighlightConfiguration::new( ts::HighlightConfiguration::new(
tree_sitter_bash::language(), tree_sitter_bash::LANGUAGE.into(),
tree_sitter_bash::HIGHLIGHT_QUERY, tree_sitter_bash::HIGHLIGHT_QUERY,
"", "",
"", "",
"",
) )
.expect("Highlighter::config: highlight configuration must be valid") .expect("Highlighter::config: highlight configuration must be valid")
})), })),
"c" => Some(self.configs.entry(language).or_insert_with(|| { "c" => Some(self.configs.entry(language).or_insert_with(|| {
ts::HighlightConfiguration::new( ts::HighlightConfiguration::new(
tree_sitter_c::language(), tree_sitter_c::LANGUAGE.into(),
tree_sitter_c::HIGHLIGHT_QUERY, tree_sitter_c::HIGHLIGHT_QUERY,
"", "",
"", "",
"",
) )
.expect("Highlighter::config: highlight configuration must be valid") .expect("Highlighter::config: highlight configuration must be valid")
})), })),
"python" => Some(self.configs.entry(language).or_insert_with(|| { "python" => Some(self.configs.entry(language).or_insert_with(|| {
ts::HighlightConfiguration::new( ts::HighlightConfiguration::new(
tree_sitter_python::language(), tree_sitter_python::LANGUAGE.into(),
tree_sitter_python::HIGHLIGHT_QUERY, tree_sitter_python::HIGHLIGHTS_QUERY,
"",
"", "",
"", "",
) )
@ -301,35 +310,39 @@ impl Highlighter {
})), })),
"ruby" => Some(self.configs.entry(language).or_insert_with(|| { "ruby" => Some(self.configs.entry(language).or_insert_with(|| {
ts::HighlightConfiguration::new( ts::HighlightConfiguration::new(
tree_sitter_ruby::language(), tree_sitter_ruby::LANGUAGE.into(),
tree_sitter_ruby::HIGHLIGHT_QUERY, tree_sitter_ruby::HIGHLIGHTS_QUERY,
"", "",
tree_sitter_ruby::LOCALS_QUERY, tree_sitter_ruby::LOCALS_QUERY,
"",
) )
.expect("Highlighter::config: highlight configuration must be valid") .expect("Highlighter::config: highlight configuration must be valid")
})), })),
"tsx" => Some(self.configs.entry(language).or_insert_with(|| { "tsx" => Some(self.configs.entry(language).or_insert_with(|| {
ts::HighlightConfiguration::new( ts::HighlightConfiguration::new(
tree_sitter_typescript::language_tsx(), tree_sitter_typescript::LANGUAGE_TSX.into(),
tree_sitter_typescript::HIGHLIGHT_QUERY, tree_sitter_typescript::HIGHLIGHTS_QUERY,
"", "",
tree_sitter_typescript::LOCALS_QUERY, tree_sitter_typescript::LOCALS_QUERY,
"",
) )
.expect("Highlighter::config: highlight configuration must be valid") .expect("Highlighter::config: highlight configuration must be valid")
})), })),
"html" => Some(self.configs.entry(language).or_insert_with(|| { "html" => Some(self.configs.entry(language).or_insert_with(|| {
ts::HighlightConfiguration::new( ts::HighlightConfiguration::new(
tree_sitter_html::language(), tree_sitter_html::LANGUAGE.into(),
tree_sitter_html::HIGHLIGHTS_QUERY, tree_sitter_html::HIGHLIGHTS_QUERY,
tree_sitter_html::INJECTIONS_QUERY, tree_sitter_html::INJECTIONS_QUERY,
"", "",
"",
) )
.expect("Highlighter::config: highlight configuration must be valid") .expect("Highlighter::config: highlight configuration must be valid")
})), })),
"toml" => Some(self.configs.entry(language).or_insert_with(|| { "toml" => Some(self.configs.entry(language).or_insert_with(|| {
ts::HighlightConfiguration::new( ts::HighlightConfiguration::new(
tree_sitter_toml::language(), tree_sitter_toml_ng::language(),
tree_sitter_toml::HIGHLIGHT_QUERY, tree_sitter_toml_ng::HIGHLIGHTS_QUERY,
"",
"", "",
"", "",
) )