Radish alpha
r
rad:z4D5UCArafTzTQpDZNQRuqswh3ury
Radicle desktop app
Radicle
Git
Add `diff` syntax highlighting
Sebastian Martinez committed 11 months ago
commit 9c12f3ae7f1a7bbec3969c84e1b820e22678a869
parent bc600c7
3 files changed +23 -0
modified Cargo.lock
@@ -4105,6 +4105,7 @@ dependencies = [
 "tree-sitter-bash",
 "tree-sitter-c",
 "tree-sitter-css",
+
 "tree-sitter-diff",
 "tree-sitter-go",
 "tree-sitter-highlight",
 "tree-sitter-html",
@@ -6139,6 +6140,16 @@ dependencies = [
]

[[package]]
+
name = "tree-sitter-diff"
+
version = "0.1.0"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "dfe1e5ca280a65dfe5ba4205c1bcc84edf486464fed315db53dee6da9a335889"
+
dependencies = [
+
 "cc",
+
 "tree-sitter-language",
+
]
+

+
[[package]]
name = "tree-sitter-go"
version = "0.23.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
modified crates/radicle-types/Cargo.toml
@@ -24,6 +24,7 @@ thiserror = { version = "2.0.12" }
tree-sitter-bash = { version = "0.23.3" }
tree-sitter-c = { version = "0.23.2" }
tree-sitter-css = { version = "0.23.1" }
+
tree-sitter-diff = { version = "0.1.0" }
tree-sitter-go = { version = "0.23.4" }
tree-sitter-highlight = { version = "0.25.3" }
tree-sitter-html = { version = "0.23.2" }
modified crates/radicle-types/src/syntax.rs
@@ -250,6 +250,7 @@ impl Highlighter {
            ("rust", Self::config("rust")),
            ("json", Self::config("json")),
            ("jsdoc", Self::config("jsdoc")),
+
            ("diff", Self::config("diff")),
            ("typescript", Self::config("typescript")),
            ("javascript", Self::config("javascript")),
            ("markdown", Self::config("markdown")),
@@ -337,6 +338,16 @@ impl Highlighter {
                )
                .expect("Highlighter::config: highlight configuration must be valid"),
            ),
+
            "diff" => Some(
+
                ts::HighlightConfiguration::new(
+
                    tree_sitter_diff::LANGUAGE.into(),
+
                    language,
+
                    tree_sitter_diff::HIGHLIGHTS_QUERY,
+
                    "",
+
                    "",
+
                )
+
                .expect("Highlighter::config: highlight configuration must be valid"),
+
            ),
            "json" => Some(
                ts::HighlightConfiguration::new(
                    tree_sitter_json::LANGUAGE.into(),