bump treesitter to 0.24

This commit is contained in:
Maciej Jur 2024-10-09 13:10:50 +02:00
parent 7216068e5c
commit adcc2e42d3
Signed by: kamov
GPG key ID: 191CBFF5F72ECAFD
10 changed files with 53 additions and 44 deletions

47
Cargo.lock generated
View file

@ -111,12 +111,6 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "base64"
version = "0.22.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
[[package]]
name = "biblatex"
version = "0.9.3"
@ -192,9 +186,9 @@ dependencies = [
[[package]]
name = "cc"
version = "1.1.18"
version = "1.1.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476"
checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1"
dependencies = [
"shlex",
]
@ -734,9 +728,7 @@ dependencies = [
name = "hauchiwa"
version = "0.0.3"
dependencies = [
"base64",
"camino",
"chrono",
"glob",
"grass",
"gray_matter",
@ -746,7 +738,6 @@ dependencies = [
"notify-debouncer-full",
"rayon",
"serde",
"serde_json",
"sha2",
"tungstenite",
]
@ -989,6 +980,7 @@ dependencies = [
"tree-sitter-javascript",
"tree-sitter-language",
"tree-sitter-md",
"tree-sitter-nix",
"tree-sitter-ocaml",
"tree-sitter-python",
"tree-sitter-regex",
@ -1597,6 +1589,12 @@ dependencies = [
"lock_api",
]
[[package]]
name = "streaming-iterator"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b2231b7c3057d5e4ad0156fb3dc807d900806020c5ffa3ee6ff2c8c76fb8520"
[[package]]
name = "strsim"
version = "0.10.0"
@ -1667,18 +1665,18 @@ dependencies = [
[[package]]
name = "thiserror"
version = "1.0.63"
version = "1.0.64"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724"
checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.63"
version = "1.0.64"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261"
checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3"
dependencies = [
"proc-macro2",
"quote",
@ -1722,13 +1720,14 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tree-sitter"
version = "0.23.0"
version = "0.24.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20f4cd3642c47a85052a887d86704f4eac272969f61b686bdd3f772122aabaff"
checksum = "23b84f60031bf8245b563a80c92c1034e557a914f7958f474bc0afa2eed78b98"
dependencies = [
"cc",
"regex",
"regex-syntax",
"streaming-iterator",
"tree-sitter-language",
]
@ -1754,12 +1753,13 @@ dependencies = [
[[package]]
name = "tree-sitter-highlight"
version = "0.23.0"
version = "0.24.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "395d7a477a4504fd7d5e4d003e0dd41bd5b9c4985d53592a943a8354ec452dae"
checksum = "5c727fb31f816c09fc54dc0e971d101318926866f7261b2acb820e84a61bf52d"
dependencies = [
"lazy_static",
"regex",
"streaming-iterator",
"thiserror",
"tree-sitter",
]
@ -1800,6 +1800,15 @@ dependencies = [
"tree-sitter-language",
]
[[package]]
name = "tree-sitter-nix"
version = "0.0.1"
source = "git+https://github.com/nix-community/tree-sitter-nix?rev=9ef77ce#9ef77ceefff61d31a63133d8d697f219ab62c841"
dependencies = [
"cc",
"tree-sitter",
]
[[package]]
name = "tree-sitter-ocaml"
version = "0.23.1"

View file

@ -3,7 +3,6 @@ name = "kamoshi"
version = "0.1.0"
edition = "2021"
[dependencies.hauchiwa]
path = "../hauchiwa"
@ -25,9 +24,9 @@ serde = { version = "1.0.208", features = ["derive"] }
pulldown-cmark = "0.12.0"
# Treesitter
tree-sitter = "0.23"
tree-sitter-highlight = "0.23"
tree-sitter-language = "0.1.0"
tree-sitter = "0.24"
tree-sitter-highlight = "0.24"
tree-sitter-language = "0.1"
# Treesitter languages
tree-sitter-css = "0.23"
@ -35,8 +34,8 @@ tree-sitter-haskell = "0.23"
tree-sitter-html = "0.23"
tree-sitter-javascript = "0.23"
tree-sitter-md = "0.3"
# tree-sitter-nix = { package = "npezza93-tree-sitter-nix", version = "0.0.2" }
tree-sitter-ocaml = "0.23.1"
tree-sitter-nix = { git = "https://github.com/nix-community/tree-sitter-nix", rev = "9ef77ce" }
tree-sitter-ocaml = "0.23"
tree-sitter-python = "0.23"
tree-sitter-regex = "0.23"
tree-sitter-rust = "0.23"

View file

@ -1,10 +1,9 @@
use std::collections::HashMap;
use camino::Utf8Path;
use hauchiwa::Outline;
use hypertext::{html_elements, maud_move, GlobalAttributes, Raw, Renderable};
use crate::{model::Wiki, Link, MySack};
use crate::{model::Wiki, Link, MySack, Outline};
/// Render the outline for a document
pub(crate) fn show_outline(outline: Outline) -> impl Renderable {

View file

@ -10,13 +10,13 @@ use std::collections::HashMap;
use camino::Utf8Path;
use chrono::Datelike;
use hauchiwa::{Bibliography, Outline};
use hauchiwa::Bibliography;
use hypertext::{html_elements, maud, maud_move, GlobalAttributes, Raw, Renderable};
pub(crate) use home::home;
use post::article;
use crate::{model::Post, LinkDate, MySack};
use crate::{model::Post, LinkDate, MySack, Outline};
fn navbar() -> impl Renderable {
static ITEMS: &[(&str, &str)] = &[

View file

@ -1,9 +1,9 @@
use camino::Utf8Path;
use hauchiwa::{Bibliography, Outline};
use hauchiwa::Bibliography;
use hayagriva::Library;
use hypertext::{html_elements, maud_move, GlobalAttributes, Raw, Renderable};
use crate::{model::Post, MySack};
use crate::{model::Post, MySack, Outline};
pub fn parse_content(
content: &str,

View file

@ -1,11 +1,11 @@
use std::fmt::Write;
use camino::Utf8Path;
use hauchiwa::{Bibliography, Outline};
use hauchiwa::Bibliography;
use hayagriva::Library;
use hypertext::{html_elements, maud, GlobalAttributes, Raw, Renderable};
use crate::{model::Slideshow, MySack};
use crate::{model::Slideshow, MySack, Outline};
const CSS: &str = r#"
.slides img {

View file

@ -1,9 +1,9 @@
use camino::Utf8Path;
use hauchiwa::{Bibliography, Outline};
use hauchiwa::Bibliography;
use hayagriva::Library;
use hypertext::{html_elements, maud_move, GlobalAttributes, Raw, Renderable};
use crate::{model::Wiki, MySack};
use crate::{model::Wiki, MySack, Outline};
pub fn parse_content(
content: &str,

View file

@ -32,6 +32,8 @@ struct MyData {
pub hash: String,
}
pub struct Outline(pub Vec<(String, String)>);
impl MyData {
fn new() -> Self {
let time = chrono::Utc::now();

View file

@ -1,7 +1,7 @@
use std::collections::HashMap;
use camino::Utf8Path;
use hauchiwa::{Bibliography, Outline};
use hauchiwa::Bibliography;
use hayagriva::{
archive::ArchivedStyle,
citationberg::{IndependentStyle, Locale, Style},
@ -13,7 +13,7 @@ use once_cell::sync::Lazy;
use pulldown_cmark::{CodeBlockKind, Event, Options, Parser, Tag, TagEnd, TextMergeStream};
use regex::Regex;
use crate::{ts, MySack};
use crate::{ts, MySack, Outline};
static OPTS: Lazy<Options> = Lazy::new(|| {
Options::empty()

View file

@ -115,13 +115,13 @@ static CONFIGS: Lazy<HashMap<&'static str, HighlightConfiguration>> = Lazy::new(
tree_sitter_md::INJECTION_QUERY_INLINE,
"",
),
// language!(
// "nix",
// tree_sitter_nix::language(),
// tree_sitter_nix::HIGHLIGHTS_QUERY,
// "",
// "",
// ),
language!(
"nix",
tree_sitter_nix::language(),
tree_sitter_nix::HIGHLIGHTS_QUERY,
"",
"",
),
language!(
"ocaml",
tree_sitter_ocaml::LANGUAGE_OCAML.into(),