Add Swift lanaguage detection support
@@ -236,6 +236,7 @@ enum Language {
Rust,
Scala,
Shell,
+ Swift,
TypeScript,
JavaScript,
Php,
@@ -260,6 +261,7 @@ impl fmt::Display for Language {
Language::Rust => write!(f, "Rust"),
Language::Scala => write!(f, "Scala"),
Language::Shell => write!(f, "Shell"),
+ Language::Swift => write!(f, "Swift"),
Language::TypeScript => write!(f, "TypeScript"),
Language::JavaScript => write!(f, "JavaScript"),
Language::Php => write!(f, "Php"),
@@ -548,6 +550,7 @@ impl From<tokei::LanguageType> for Language {
tokei::LanguageType::Rust => Language::Rust,
tokei::LanguageType::Scala => Language::Scala,
tokei::LanguageType::Sh => Language::Shell,
+ tokei::LanguageType::Swift => Language::Swift,
tokei::LanguageType::TypeScript => Language::TypeScript,
tokei::LanguageType::JavaScript => Language::JavaScript,
tokei::LanguageType::Php => Language::Php,
@@ -574,6 +577,7 @@ fn get_all_language_types() -> Vec<tokei::LanguageType> {
tokei::LanguageType::Rust,
tokei::LanguageType::Scala,
tokei::LanguageType::Sh,
+ tokei::LanguageType::Swift,
tokei::LanguageType::TypeScript,
tokei::LanguageType::JavaScript,
tokei::LanguageType::Php,
@@ -599,6 +603,7 @@ impl Info {
Language::Rust => include_str!("../resources/rust.ascii"),
Language::Scala => include_str!("../resources/scala.ascii"),
Language::Shell => include_str!("../resources/shell.ascii"),
+ Language::Swift => include_str!("../resources/swift.ascii"),
Language::TypeScript => include_str!("../resources/typescript.ascii"),
Language::JavaScript => include_str!("../resources/javascript.ascii"),
Language::Php => include_str!("../resources/php.ascii"),
@@ -624,6 +629,7 @@ impl Info {
Language::Rust => vec![Color::White, Color::BrightRed],
Language::Scala => vec![Color::Blue],
Language::Shell => vec![Color::Green],
+ Language::Swift => vec![Color::BrightRed],
Language::TypeScript => vec![Color::Cyan],
Language::JavaScript => vec![Color::BrightYellow],
Language::Php => vec![Color::BrightWhite],
