Skip to content

Commit

Permalink
feat: Add support for GSC (github-linguist/linguist#5634)
Browse files Browse the repository at this point in the history
  • Loading branch information
kalkin committed May 17, 2022
1 parent f0bf3fa commit d9abd1c
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 1 deletion.
12 changes: 12 additions & 0 deletions languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1949,6 +1949,18 @@ GN:
codemirror_mode: python
codemirror_mime_type: text/x-python
language_id: 302957008
GSC:
type: programming
color: "#FF6800"
extensions:
- ".gsc"
- ".csc"
- ".gsh"
tm_scope: source.gsc
ace_mode: c_cpp
codemirror_mode: clike
codemirror_mime_type: text/x-csrc
language_id: 257856279
Game Maker Language:
type: programming
color: "#71b417"
Expand Down
2 changes: 1 addition & 1 deletion linguist
1 change: 1 addition & 0 deletions src/linguist_aliases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ lazy_static! {
("gedcom".to_string(), "GEDCOM".to_string()),
("glsl".to_string(), "GLSL".to_string()),
("gn".to_string(), "GN".to_string()),
("gsc".to_string(), "GSC".to_string()),
(
"game maker language".to_string(),
"Game Maker Language".to_string()
Expand Down
3 changes: 3 additions & 0 deletions src/linguist_extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ lazy_static! {
(".vshader".to_string(), "GLSL".to_string()),
(".gn".to_string(), "GN".to_string()),
(".gni".to_string(), "GN".to_string()),
(".gsc".to_string(), "GSC".to_string()),
(".csc".to_string(), "GSC".to_string()),
(".gsh".to_string(), "GSC".to_string()),
(".kid".to_string(), "Genshi".to_string()),
(".ebuild".to_string(), "Gentoo Ebuild".to_string()),
(".eclass".to_string(), "Gentoo Eclass".to_string()),
Expand Down
54 changes: 54 additions & 0 deletions tests/linguist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5899,6 +5899,60 @@ mod gn {
}
}

mod gsc {
use file_expert::guess;
use file_expert::Guess;
use std::path::Path;

#[test]
fn test_0() {
let path = Path::new(&"./samples/GSC/array_override_common.gsc");
let actual = guess(&path).unwrap();
let expected = Guess::Kind("GSC".to_string());
assert_eq!(actual, expected);
}

#[test]
fn test_1() {
let path = Path::new(&"./samples/GSC/zm_init.gsc");
let actual = guess(&path).unwrap();
let expected = Guess::Kind("GSC".to_string());
assert_eq!(actual, expected);
}

#[test]
fn test_2() {
let path = Path::new(&"./samples/GSC/_spiderbot_ride.csc");
let actual = guess(&path).unwrap();
let expected = Guess::Kind("GSC".to_string());
assert_eq!(actual, expected);
}

#[test]
fn test_3() {
let path = Path::new(&"./samples/GSC/struct.gsc");
let actual = guess(&path).unwrap();
let expected = Guess::Kind("GSC".to_string());
assert_eq!(actual, expected);
}

#[test]
fn test_4() {
let path = Path::new(&"./samples/GSC/array_override_common.gsh");
let actual = guess(&path).unwrap();
let expected = Guess::Kind("GSC".to_string());
assert_eq!(actual, expected);
}

#[test]
fn test_5() {
let path = Path::new(&"./samples/GSC/math_shared.gsc");
let actual = guess(&path).unwrap();
let expected = Guess::Kind("GSC".to_string());
assert_eq!(actual, expected);
}
}

mod game_maker_language {
use file_expert::guess;
use file_expert::Guess;
Expand Down

0 comments on commit d9abd1c

Please sign in to comment.