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>
This commit is contained in:
Beni Ben zikry
2021-03-14 21:37:00 +02:00
committed by GitHub
parent 1651d11aad
commit dd5c62791c
9 changed files with 255 additions and 0 deletions
+44
View File
@@ -216,6 +216,7 @@ $purescript\
$python\
$ruby\
$rust\
$scala\
$swift\
$terraform\
$vagrant\
@@ -2272,6 +2273,49 @@ The module will be shown if any of the following conditions are met:
format = "via [⚙️ $version](red bold)"
```
## Scala
The `scala` module shows the currently installed version of Scala.
By default the module will be shown if any of the following conditions are met:
- The current directory contains a `build.sbt`, `.scalaenv` or `.sbtenv` file
- The current directory contains a file with the `.scala` or `.sbt` extension
- The current directory contains a directory named `.metals`
### Options
| Option | Default | Description |
| ------------------- | -------------------------------------------| ----------------------------------------------- |
| `format` | `"via [${symbol}(${version} )]($style)"` | The format for the module. |
| `detect_extensions` | `["sbt", "scala"]` | Which extensions should trigger this module. |
| `detect_files` | `[".scalaenv", ".sbtenv", "build.sbt"]` | Which filenames should trigger this module. |
| `detect_folders` | `[".metals"]` | Which folders should trigger this modules. |
| `symbol` | `"🆂 "` | A format string representing the symbol of Scala. |
| `style` | `"red dimmed"` | The style for the module. |
| `disabled` | `false` | Disables the `scala` module. |
### Variables
| Variable | Example | Description |
| -------- | -----------| ------------------------------------ |
| version | `2.13.5` | The version of `scala` |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
### Example
```toml
# ~/.config/starship.toml
[scala]
symbol = "🌟 "
```
## Shell
The `shell` module shows an indicator for currently used shell.