feat: Add Ruby Language Support (#597)

* feat: add Ruby Support

* fix: address the comments

* Update dataset.rs

---------

Co-authored-by: Meng Zhang <meng@tabbyml.com>
r0.4
Chromium 2023-10-20 20:48:37 +02:00 committed by GitHub
parent a0a703899a
commit da6109c5af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 2 deletions

11
Cargo.lock generated
View File

@ -3221,6 +3221,7 @@ dependencies = [
"tracing-test",
"tree-sitter-go",
"tree-sitter-python",
"tree-sitter-ruby",
"tree-sitter-rust",
"tree-sitter-tags",
"tree-sitter-typescript",
@ -3960,6 +3961,16 @@ dependencies = [
"tree-sitter",
]
[[package]]
name = "tree-sitter-ruby"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ac30cbb1560363ae76e1ccde543d6d99087421e228cc47afcec004b86bb711a"
dependencies = [
"cc",
"tree-sitter",
]
[[package]]
name = "tree-sitter-rust"
version = "0.20.3"

View File

@ -50,4 +50,20 @@ top_level_keywords = [
"import",
"var",
"const",
]
]
[[config]]
languages = ["ruby"]
line_comment = "#"
top_level_keywords = [
"begin",
"class",
"def",
"end",
"ensure",
"include",
"module",
"require",
"rescue",
"self",
]

View File

@ -22,6 +22,7 @@ tree-sitter-python = "0.20.2"
tree-sitter-rust = "0.20.3"
tree-sitter-typescript = "0.20.3"
tree-sitter-go = "0.20.0"
tree-sitter-ruby= "0.20.0"
[dev-dependencies]
temp_testdir = "0.2"

View File

@ -270,6 +270,17 @@ lazy_static! {
.unwrap(),
),
),
(
"ruby",
TagsConfigurationSync(
TagsConfiguration::new(
tree_sitter_ruby::language(),
tree_sitter_rust::TAGGING_QUERY,
"",
)
.unwrap(),
),
),
])
};
}

View File

@ -26,6 +26,7 @@ For an actual example of an issue or pull request adding the above support, plea
* [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
* [TypeScript](https://www.typescriptlang.org/)
* [Golang](https://go.dev/): Since v0.4.0
* [Ruby](https://www.ruby-lang.org/): Since v0.4.0
## Languages Missing Certain Support
@ -40,5 +41,4 @@ For an actual example of an issue or pull request adding the above support, plea
| Lua | 🚫 | 🚫 |
| PHP | 🚫 | 🚫 |
| Perl | 🚫 | 🚫 |
| Ruby | 🚫 | 🚫 |
| Scala | 🚫 | 🚫 |