Merge pull request #1070 from caioalonso/master
Adds GLSL syntax
commitb0191cdf2c52496fd92b835adf3cb7b0787154fa
authorDavid Peter <sharkdp@users.noreply.github.com>
dateMon 29 Jun 2020, 06:10 (6 years ago)
parentfa10b48fc121f0
.gitmodules+3
@@ -185,3 +185,6 @@
185185[submodule "assets/syntaxes/02_Extra/AsciiDoc"]
186186 path = assets/syntaxes/02_Extra/AsciiDoc
187187 url = https://github.com/asciidoctor/sublimetext-asciidoc.git
188+[submodule "assets/syntaxes/02_Extra/GLSL"]
189+ path = assets/syntaxes/02_Extra/GLSL
190+ url = https://github.com/euler0/sublime-glsl
CHANGELOG.md+1
@@ -9,6 +9,7 @@
99## Syntaxes
1010
1111- Update AsciiDoc syntax, see #1034 (@rxt1077)
12+- GLSL (@caioalonso)
1213
1314## New themes
1415## `bat` as a library
assets/syntaxes/02_Extra/GLSLnew file+1
Submodule changed.
src/assets.rs+1
@@ -428,6 +428,7 @@ mod tests {
428428 assert_eq!(test.syntax_for_file("test.h"), "C++");
429429 assert_eq!(test.syntax_for_file("test.sass"), "Sass");
430430 assert_eq!(test.syntax_for_file("test.js"), "JavaScript (Babel)");
431+ assert_eq!(test.syntax_for_file("test.fs"), "F#");
431432 }
432433
433434 #[test]
src/syntax_mapping.rs+1
@@ -23,6 +23,7 @@ impl<'a> SyntaxMapping<'a> {
2323 pub fn builtin() -> SyntaxMapping<'a> {
2424 let mut mapping = Self::empty();
2525 mapping.insert("*.h", MappingTarget::MapTo("C++")).unwrap();
26+ mapping.insert("*.fs", MappingTarget::MapTo("F#")).unwrap();
2627 mapping
2728 .insert("build", MappingTarget::MapToUnknown)
2829 .unwrap();
tests/no_duplicate_extensions.rs+2
@@ -14,6 +14,8 @@ fn no_duplicate_extensions() {
1414 // The "Ruby Haml" syntax also comes with a '.sass' extension. However, we make sure
1515 // that 'sass' is mapped to the 'Sass' syntax.
1616 "sass",
17+ // The '.fs' extension appears in F# and GLSL. We default to F#.
18+ "fs",
1719 ];
1820
1921 let assets = HighlightingAssets::from_binary();