Files
oak-gpui/crates/languages/src/bash/config.toml
T
Étienne BERSACandMarshall Bowers e6749b5955 Use shell script language for bats files (#24877)
bats is a superset of bash. It's a common tool for writing TAP tests in
bash.

https://bats-core.readthedocs.io/en/stable/tutorial.html#your-first-test

Release Notes:

- Added recognition for `.bats` files as "Shell Script".

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-14 17:34:43 -05:00

29 lines
1.2 KiB
TOML

name = "Shell Script"
code_fence_block_name = "bash"
grammar = "bash"
path_suffixes = ["sh", "bash", "bashrc", "bash_profile", "bash_aliases", "bash_logout", "bats", "profile", "zsh", "zshrc", "zshenv", "zsh_profile", "zsh_aliases", "zsh_histfile", "zlogin", "zprofile", ".env", "PKGBUILD"]
line_comments = ["# "]
first_line_pattern = '^#!.*\b(?:ash|bash|bats|dash|sh|zsh)\b'
brackets = [
{ start = "[", end = "]", close = true, newline = false },
{ start = "(", end = ")", close = true, newline = true },
{ start = "{", end = "}", close = true, newline = true },
{ start = "\"", end = "\"", close = true, newline = false, not_in = ["comment", "string"] },
{ start = "'", end = "'", close = true, newline = false, not_in = ["string", "comment"] },
]
### WARN: the following is not working when you insert an `elif` just before an else
### example: (^ is cursor after hitting enter)
### ```
### if true; then
### foo
### elif
### ^
### else
### bar
### fi
### ```
increase_indent_pattern = "(\\s*|;)(do|then|in|else|elif)\\b.*$"
decrease_indent_pattern = "(\\s*|;)\\b(fi|done|esac|else|elif)\\b.*$"
# make sure to test each line mode & block mode