Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
cli: fix syntax highlighting
Merged fintohaps opened 1 year ago

There was mishap in updating the parameters of highlight configuration – so many string types!

This is fixed by adding the correct name parameter, reusing the language variable that is being matched on.

3 files changed +16 -16 7ed72ec9 d9c76893
modified Cargo.lock
@@ -1903,7 +1903,7 @@ dependencies = [

[[package]]
name = "radicle-cli"
-
version = "0.12.0"
+
version = "0.12.1"
dependencies = [
 "anyhow",
 "chrono",
@@ -2153,7 +2153,7 @@ version = "0.9.0"

[[package]]
name = "radicle-term"
-
version = "0.11.0"
+
version = "0.12.0"
dependencies = [
 "anstyle-query",
 "anyhow",
modified radicle-cli/Cargo.toml
@@ -3,7 +3,7 @@ name = "radicle-cli"
description = "Radicle CLI"
homepage = "https://radicle.xyz"
license = "MIT OR Apache-2.0"
-
version = "0.12.0"
+
version = "0.12.1"
authors = ["cloudhead <cloudhead@radicle.xyz>"]
edition = "2021"
build = "build.rs"
modified radicle-cli/src/terminal/highlight.rs
@@ -221,130 +221,130 @@ impl Highlighter {
            "rust" => Some(self.configs.entry(language).or_insert_with(|| {
                ts::HighlightConfiguration::new(
                    tree_sitter_rust::LANGUAGE.into(),
+
                    language,
                    tree_sitter_rust::HIGHLIGHTS_QUERY,
                    tree_sitter_rust::INJECTIONS_QUERY,
                    "",
-
                    "",
                )
                .expect("Highlighter::config: highlight configuration must be valid")
            })),
            "json" => Some(self.configs.entry(language).or_insert_with(|| {
                ts::HighlightConfiguration::new(
                    tree_sitter_json::LANGUAGE.into(),
+
                    language,
                    tree_sitter_json::HIGHLIGHTS_QUERY,
                    "",
                    "",
-
                    "",
                )
                .expect("Highlighter::config: highlight configuration must be valid")
            })),
            "typescript" => Some(self.configs.entry(language).or_insert_with(|| {
                ts::HighlightConfiguration::new(
                    tree_sitter_typescript::LANGUAGE_TYPESCRIPT.into(),
+
                    language,
                    tree_sitter_typescript::HIGHLIGHTS_QUERY,
                    "",
                    tree_sitter_typescript::LOCALS_QUERY,
-
                    "",
                )
                .expect("Highlighter::config: highlight configuration must be valid")
            })),
            "markdown" => Some(self.configs.entry(language).or_insert_with(|| {
                ts::HighlightConfiguration::new(
                    tree_sitter_md::LANGUAGE.into(),
+
                    language,
                    tree_sitter_md::HIGHLIGHT_QUERY_BLOCK,
                    tree_sitter_md::INJECTION_QUERY_BLOCK,
                    "",
-
                    "",
                )
                .expect("Highlighter::config: highlight configuration must be valid")
            })),
            "css" => Some(self.configs.entry(language).or_insert_with(|| {
                ts::HighlightConfiguration::new(
                    tree_sitter_css::LANGUAGE.into(),
+
                    language,
                    tree_sitter_css::HIGHLIGHTS_QUERY,
                    "",
                    "",
-
                    "",
                )
                .expect("Highlighter::config: highlight configuration must be valid")
            })),
            "go" => Some(self.configs.entry(language).or_insert_with(|| {
                ts::HighlightConfiguration::new(
                    tree_sitter_go::LANGUAGE.into(),
+
                    language,
                    tree_sitter_go::HIGHLIGHTS_QUERY,
                    "",
                    "",
-
                    "",
                )
                .expect("Highlighter::config: highlight configuration must be valid")
            })),
            "shell" => Some(self.configs.entry(language).or_insert_with(|| {
                ts::HighlightConfiguration::new(
                    tree_sitter_bash::LANGUAGE.into(),
+
                    language,
                    tree_sitter_bash::HIGHLIGHT_QUERY,
                    "",
                    "",
-
                    "",
                )
                .expect("Highlighter::config: highlight configuration must be valid")
            })),
            "c" => Some(self.configs.entry(language).or_insert_with(|| {
                ts::HighlightConfiguration::new(
                    tree_sitter_c::LANGUAGE.into(),
+
                    language,
                    tree_sitter_c::HIGHLIGHT_QUERY,
                    "",
                    "",
-
                    "",
                )
                .expect("Highlighter::config: highlight configuration must be valid")
            })),
            "python" => Some(self.configs.entry(language).or_insert_with(|| {
                ts::HighlightConfiguration::new(
                    tree_sitter_python::LANGUAGE.into(),
+
                    language,
                    tree_sitter_python::HIGHLIGHTS_QUERY,
                    "",
                    "",
-
                    "",
                )
                .expect("Highlighter::config: highlight configuration must be valid")
            })),
            "ruby" => Some(self.configs.entry(language).or_insert_with(|| {
                ts::HighlightConfiguration::new(
                    tree_sitter_ruby::LANGUAGE.into(),
+
                    language,
                    tree_sitter_ruby::HIGHLIGHTS_QUERY,
                    "",
                    tree_sitter_ruby::LOCALS_QUERY,
-
                    "",
                )
                .expect("Highlighter::config: highlight configuration must be valid")
            })),
            "tsx" => Some(self.configs.entry(language).or_insert_with(|| {
                ts::HighlightConfiguration::new(
                    tree_sitter_typescript::LANGUAGE_TSX.into(),
+
                    language,
                    tree_sitter_typescript::HIGHLIGHTS_QUERY,
                    "",
                    tree_sitter_typescript::LOCALS_QUERY,
-
                    "",
                )
                .expect("Highlighter::config: highlight configuration must be valid")
            })),
            "html" => Some(self.configs.entry(language).or_insert_with(|| {
                ts::HighlightConfiguration::new(
                    tree_sitter_html::LANGUAGE.into(),
+
                    language,
                    tree_sitter_html::HIGHLIGHTS_QUERY,
                    tree_sitter_html::INJECTIONS_QUERY,
                    "",
-
                    "",
                )
                .expect("Highlighter::config: highlight configuration must be valid")
            })),
            "toml" => Some(self.configs.entry(language).or_insert_with(|| {
                ts::HighlightConfiguration::new(
                    tree_sitter_toml_ng::language(),
+
                    language,
                    tree_sitter_toml_ng::HIGHLIGHTS_QUERY,
                    "",
                    "",
-
                    "",
                )
                .expect("Highlighter::config: highlight configuration must be valid")
            })),