feat: supports java (#715)

* feat: add java language configuration

* feat: add java repository context support

* Update programming-languages.md

* added rev to tree-sitter-java

Signed-off-by: Lei Wen <wenlei03@qiyi.com>
Co-authored-by: Lei Wen <wenlei03@qiyi.com>
refactor-extract-code
leiwen83 2023-11-08 15:59:00 +08:00 committed by GitHub
parent b0a62e4af9
commit 3fb8445747
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 46 additions and 1 deletions

11
Cargo.lock generated
View File

@ -4158,6 +4158,7 @@ dependencies = [
"tracing",
"tracing-test",
"tree-sitter-go",
"tree-sitter-java",
"tree-sitter-python",
"tree-sitter-ruby",
"tree-sitter-rust",
@ -4902,6 +4903,16 @@ dependencies = [
"tree-sitter",
]
[[package]]
name = "tree-sitter-java"
version = "0.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2adc5696bf5abf761081d7457d2bb82d0e3b28964f4214f63fd7e720ef462653"
dependencies = [
"cc",
"tree-sitter",
]
[[package]]
name = "tree-sitter-python"
version = "0.20.2"

View File

@ -19,6 +19,28 @@ top_level_keywords = [
"use",
]
[[config]]
languages = ["java"]
line_comment = "//"
top_level_keywords = [
"abstract",
"public",
"private",
"class",
"const",
"exports",
"extends",
"implements",
"static",
"import",
"interface",
"module",
"package",
"var",
"enum",
"return",
]
[[config]]
languages = ["javascript", "typescript", "javascriptreact", "typescriptreact"]
line_comment = "//"

View File

@ -16,6 +16,7 @@ lazy_static = { workspace = true }
serde-jsonlines = { workspace = true }
file-rotate = "0.7.5"
tree-sitter-python = "0.20.2"
tree-sitter-java = "0.20.2"
tree-sitter-rust = "0.20.3"
tree-sitter-typescript = "0.20.3"
tree-sitter-go = "0.20.0"

View File

@ -238,6 +238,17 @@ lazy_static! {
.unwrap(),
),
),
(
"java",
TagsConfigurationSync(
TagsConfiguration::new(
tree_sitter_java::language(),
tree_sitter_java::TAGGING_QUERY,
"",
)
.unwrap(),
),
),
(
"javascript-typescript",
TagsConfigurationSync(

View File

@ -27,6 +27,7 @@ For an actual example of an issue or pull request adding the above support, plea
* [TypeScript](https://www.typescriptlang.org/)
* [Golang](https://go.dev/): Since v0.4.0
* [Ruby](https://www.ruby-lang.org/): Since v0.4.0
* [Java](https://www.java.com/): Since v0.6.0
## Languages Missing Certain Support
@ -36,7 +37,6 @@ For an actual example of an issue or pull request adding the above support, plea
| C# | 🚫 | 🚫 |
| CSS | 🚫 | 🚫 |
| Haskell | 🚫 | 🚫 |
| Java | 🚫 | 🚫 |
| Julia | 🚫 | 🚫 |
| Lua | 🚫 | 🚫 |
| PHP | 🚫 | 🚫 |