Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Bash support #2532

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 33 additions & 4 deletions crates/tabby-common/assets/languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,39 @@ exts = ["pl", "pm", "pod", "perl"]
languages = ["powershell"]
exts = ["ps1", "psd1", "psm1"]

[[config]]
languages = ["shellscript"]
exts = ["sh", "bash", "command", "zsh"]
line_comment = "#"
top_level_keywords = [
"break",
"case",
"coproc",
"continue",
"do",
"done",
"else",
"elif",
"end",
"esac",
"eval",
"exec",
"exit",
"for",
"fi",
"function",
"if",
"in",
"return",
"select",
"shift",
"source",
"then",
"until",
"wait",
"while"
]

[[config]]
languages = ["sql"]
exts = ["sql"]
Expand All @@ -323,10 +356,6 @@ exts = ["sql"]
languages = ["scala"]
exts = ["scala"]

[[config]]
languages = ["shellscript"]
exts = ["sh", "bash", "command", "zsh"]

[[config]]
languages = ["tex"]
exts = ["tex"]
Expand Down
1 change: 1 addition & 0 deletions crates/tabby-scheduler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ tree-sitter-cpp = { git = "https://github.com/tree-sitter/tree-sitter-cpp", rev
tree-sitter-c-sharp = "0.21.2"
tree-sitter-solidity = { git = "https://github.com/JoranHonig/tree-sitter-solidity", rev = "0e86ae647bda22c9bee00ec59752df7b3d3b000b" }
tree-sitter-lua = "0.1.0"
tree-sitter-bash = { git = "https://github.com/tree-sitter/tree-sitter-bash", rev = "2fbd860" }
ignore.workspace = true
tokio = { workspace = true, features = ["process"] }
text-splitter = { version = "0.13.3", features = ["code"] }
Expand Down
3 changes: 3 additions & 0 deletions crates/tabby-scheduler/queries/bash.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(
(function_definition (identifier) @name) @definition.function
)
11 changes: 11 additions & 0 deletions crates/tabby-scheduler/src/code/languages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,17 @@ lazy_static! {
.unwrap(),
),
),
(
"bash",
TagsConfigurationSync(
TagsConfiguration::new(
tree_sitter_bash::language(),
include_str!("../../queries/bash.scm"),
"",
)
.unwrap(),
),
),
])
};
}
3 changes: 2 additions & 1 deletion website/docs/programming-languages.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ For an actual example of an issue or pull request adding the above support, plea
* [Solidity](https://soliditylang.org/): Since v0.10.0
* [R](https://www.r-project.org/): Since v0.12.0
* [Dart](https://dart.dev/): Since v0.12.0
wsxiaoys marked this conversation as resolved.
Show resolved Hide resolved
* [Lua](https://www.lua.org): Since 0.14.0
* [Lua](https://www.lua.org): Since v0.14.0
* [Bash / shellscript](https://www.gnu.org/software/bash/): Since v0.14.0

## Languages Missing Certain Support

Expand Down
Loading