From 233d3759831e8fb49ce7f5b458ef89ead2f82e1f Mon Sep 17 00:00:00 2001 From: Caio Alonso Date: Mon, 22 Jun 2020 22:19:48 -0300 Subject: [PATCH 1/2] Adds GLSL syntax --- .gitmodules | 3 +++ CHANGELOG.md | 1 + assets/syntaxes/02_Extra/GLSL | 1 + 3 files changed, 5 insertions(+) create mode 160000 assets/syntaxes/02_Extra/GLSL diff --git a/.gitmodules b/.gitmodules index 6b1cff40..d619f27a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -185,3 +185,6 @@ [submodule "assets/syntaxes/02_Extra/AsciiDoc"] path = assets/syntaxes/02_Extra/AsciiDoc url = https://github.com/asciidoctor/sublimetext-asciidoc.git +[submodule "assets/syntaxes/02_Extra/GLSL"] + path = assets/syntaxes/02_Extra/GLSL + url = https://github.com/euler0/sublime-glsl diff --git a/CHANGELOG.md b/CHANGELOG.md index bfd57e69..5a168c47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ## Syntaxes - Update AsciiDoc syntax, see #1034 (@rxt1077) +- GLSL (@caioalonso) ## New themes ## `bat` as a library diff --git a/assets/syntaxes/02_Extra/GLSL b/assets/syntaxes/02_Extra/GLSL new file mode 160000 index 00000000..4cd4acff --- /dev/null +++ b/assets/syntaxes/02_Extra/GLSL @@ -0,0 +1 @@ +Subproject commit 4cd4acfffc7f2ab4f154b6ebfbbe0bb71825eb89 From fc121f0c8702a23951596850f7bec2bb2de5b45b Mon Sep 17 00:00:00 2001 From: Caio Alonso Date: Fri, 26 Jun 2020 21:42:05 -0300 Subject: [PATCH 2/2] Defaults *.fs to F# --- src/assets.rs | 1 + src/syntax_mapping.rs | 1 + tests/no_duplicate_extensions.rs | 2 ++ 3 files changed, 4 insertions(+) diff --git a/src/assets.rs b/src/assets.rs index 86c3fe0b..b30fa3b7 100644 --- a/src/assets.rs +++ b/src/assets.rs @@ -428,6 +428,7 @@ mod tests { assert_eq!(test.syntax_for_file("test.h"), "C++"); assert_eq!(test.syntax_for_file("test.sass"), "Sass"); assert_eq!(test.syntax_for_file("test.js"), "JavaScript (Babel)"); + assert_eq!(test.syntax_for_file("test.fs"), "F#"); } #[test] diff --git a/src/syntax_mapping.rs b/src/syntax_mapping.rs index 0b1feb82..0b65ae65 100644 --- a/src/syntax_mapping.rs +++ b/src/syntax_mapping.rs @@ -23,6 +23,7 @@ impl<'a> SyntaxMapping<'a> { pub fn builtin() -> SyntaxMapping<'a> { let mut mapping = Self::empty(); mapping.insert("*.h", MappingTarget::MapTo("C++")).unwrap(); + mapping.insert("*.fs", MappingTarget::MapTo("F#")).unwrap(); mapping .insert("build", MappingTarget::MapToUnknown) .unwrap(); diff --git a/tests/no_duplicate_extensions.rs b/tests/no_duplicate_extensions.rs index 2f3b5c08..3f2f1460 100644 --- a/tests/no_duplicate_extensions.rs +++ b/tests/no_duplicate_extensions.rs @@ -14,6 +14,8 @@ fn no_duplicate_extensions() { // The "Ruby Haml" syntax also comes with a '.sass' extension. However, we make sure // that 'sass' is mapped to the 'Sass' syntax. "sass", + // The '.fs' extension appears in F# and GLSL. We default to F#. + "fs", ]; let assets = HighlightingAssets::from_binary();