From b5d54865f01f9a3390495a7875cc68c379e761b8 Mon Sep 17 00:00:00 2001 From: Bahtiar `kalkin` Gadimov Date: Tue, 17 May 2022 19:19:43 +0200 Subject: [PATCH] feat: Add support for Gleam programming language (github/linguist#5688) --- languages.yml | 8 ++++++++ linguist | 2 +- src/linguist_aliases.rs | 1 + src/linguist_extensions.rs | 1 + tests/linguist.rs | 22 ++++++++++++++++++++++ 5 files changed, 33 insertions(+), 1 deletion(-) diff --git a/languages.yml b/languages.yml index c951d4b..9ce2b09 100644 --- a/languages.yml +++ b/languages.yml @@ -2080,6 +2080,14 @@ Git Config: codemirror_mime_type: text/x-properties tm_scope: source.gitconfig language_id: 807968997 +Gleam: + type: programming + color: "#ffaff3" + ace_mode: text + extensions: + - ".gleam" + tm_scope: source.gleam + language_id: 1054258749 Glyph: type: programming color: "#c1ac7f" diff --git a/linguist b/linguist index 9df3aa1..977f3d3 160000 --- a/linguist +++ b/linguist @@ -1 +1 @@ -Subproject commit 9df3aa1f4c1018467afae908aa17a21b867a1055 +Subproject commit 977f3d3050f4a3143f56ca6a5cb97488848dbe9e diff --git a/src/linguist_aliases.rs b/src/linguist_aliases.rs index ee08a32..6f37433 100644 --- a/src/linguist_aliases.rs +++ b/src/linguist_aliases.rs @@ -337,6 +337,7 @@ lazy_static! { ("git config".to_string(), "Git Config".to_string()), ("gitconfig".to_string(), "Git Config".to_string()), ("gitmodules".to_string(), "Git Config".to_string()), + ("gleam".to_string(), "Gleam".to_string()), ("glyph".to_string(), "Glyph".to_string()), ( "glyph bitmap distribution format".to_string(), diff --git a/src/linguist_extensions.rs b/src/linguist_extensions.rs index 38aeda1..56e9ae1 100644 --- a/src/linguist_extensions.rs +++ b/src/linguist_extensions.rs @@ -309,6 +309,7 @@ lazy_static! { (".feature".to_string(), "Gherkin".to_string()), (".story".to_string(), "Gherkin".to_string()), (".gitconfig".to_string(), "Git Config".to_string()), + (".gleam".to_string(), "Gleam".to_string()), (".glf".to_string(), "Glyph".to_string()), ( ".bdf".to_string(), diff --git a/tests/linguist.rs b/tests/linguist.rs index 5a73362..8add7af 100644 --- a/tests/linguist.rs +++ b/tests/linguist.rs @@ -6231,6 +6231,28 @@ mod git_config { } } +mod gleam { + use file_expert::guess; + use file_expert::Guess; + use std::path::Path; + + #[test] + fn test_0() { + let path = Path::new(&"./samples/Gleam/websocket.gleam"); + let actual = guess(&path).unwrap(); + let expected = Guess::Kind("Gleam".to_string()); + assert_eq!(actual, expected); + } + + #[test] + fn test_1() { + let path = Path::new(&"./samples/Gleam/contributor.gleam"); + let actual = guess(&path).unwrap(); + let expected = Guess::Kind("Gleam".to_string()); + assert_eq!(actual, expected); + } +} + mod glyph_bitmap_distribution_format { use file_expert::guess; use file_expert::Guess;