diff options
author | Beni Ben zikry <bbenzikry@gmail.com> | 2021-03-14 21:37:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-14 20:37:00 +0100 |
commit | dd5c62791cc96f89588af5827e014a56790ceb4c (patch) | |
tree | 4fb0ee57adf4f9db3a9beef9394457853a79defc /src/configs/scala.rs | |
parent | 1651d11aad3f3fc41c0d2e3371f866c6e8f532fc (diff) |
feat(scala): Add scala module (#2409)
* Add support for scala ( w/o sbt )
* Add scala description
* Change scala color to bold red
* update scala extensions in README
* failed lint
* cr changes ( regex, simplify parsing, imports )
* Scala readme punctuation
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
Diffstat (limited to 'src/configs/scala.rs')
-rw-r--r-- | src/configs/scala.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/configs/scala.rs b/src/configs/scala.rs new file mode 100644 index 000000000..3c5fc670e --- /dev/null +++ b/src/configs/scala.rs @@ -0,0 +1,28 @@ +use crate::config::{ModuleConfig, RootModuleConfig}; + +use starship_module_config_derive::ModuleConfig; + +#[derive(Clone, ModuleConfig)] +pub struct ScalaConfig<'a> { + pub disabled: bool, + pub format: &'a str, + pub style: &'a str, + pub symbol: &'a str, + pub detect_extensions: Vec<&'a str>, + pub detect_files: Vec<&'a str>, + pub detect_folders: Vec<&'a str>, +} + +impl<'a> RootModuleConfig<'a> for ScalaConfig<'a> { + fn new() -> Self { + ScalaConfig { + format: "via [$symbol($version )]($style)", + disabled: false, + style: "red bold", + symbol: "🆂 ", + detect_extensions: vec!["sbt", "scala"], + detect_files: vec![".scalaenv", ".sbtenv", "build.sbt"], + detect_folders: vec![".metals"], + } + } +} |