feat: supports PHP (#634)

* feat: add php language configuration

* feat: add php repository context support

* docs: update documentation to indicate php support

* Update programming-languages.md

* added rev to tree-sitter-php

---------

Co-authored-by: Aleksandr Tarabaka <aleksandr.tarabaka@privatbank.ua>
Co-authored-by: Meng Zhang <meng@tabbyml.com>
add-llama-model-converter
Oleksandr 2023-10-26 22:27:57 +03:00 committed by GitHub
parent 6e59aa8d81
commit 688e7d75b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 51 additions and 1 deletions

10
Cargo.lock generated
View File

@ -3261,6 +3261,7 @@ dependencies = [
"tracing",
"tracing-test",
"tree-sitter-go",
"tree-sitter-php",
"tree-sitter-python",
"tree-sitter-ruby",
"tree-sitter-rust",
@ -3991,6 +3992,15 @@ dependencies = [
"tree-sitter",
]
[[package]]
name = "tree-sitter-php"
version = "0.19.1"
source = "git+https://github.com/tree-sitter/tree-sitter-php.git#0e02e7fab7913a0e77343edb347c8f17cac1f0ba"
dependencies = [
"cc",
"tree-sitter",
]
[[package]]
name = "tree-sitter-python"
version = "0.20.2"

View File

@ -67,3 +67,31 @@ top_level_keywords = [
"rescue",
"self",
]
[[config]]
languages = ["php"]
line_comment = "//"
top_level_keywords = [
"abstract",
"class",
"const",
"declare",
"extends",
"final",
"finally",
"function",
"global",
"implements",
"include_once",
"include",
"interface",
"namespace",
"private",
"protected",
"public",
"require_once",
"require",
"static",
"trait",
"use",
]

View File

@ -22,6 +22,7 @@ tree-sitter-rust = "0.20.3"
tree-sitter-typescript = "0.20.3"
tree-sitter-go = "0.20.0"
tree-sitter-ruby= "0.20.0"
tree-sitter-php = { git = "https://github.com/tree-sitter/tree-sitter-php.git", rev = "0e02e7f" }
ignore = "0.4.20"
[dev-dependencies]

View File

@ -271,6 +271,17 @@ lazy_static! {
.unwrap(),
),
),
(
"php",
TagsConfigurationSync(
TagsConfiguration::new(
tree_sitter_php::language(),
tree_sitter_php::TAGS_QUERY,
"",
)
.unwrap(),
),
),
])
};
}

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
* [PHP](https://www.php.net/): Since v0.5.0
## Languages Missing Certain Support
@ -39,6 +40,5 @@ For an actual example of an issue or pull request adding the above support, plea
| Java | 🚫 | 🚫 |
| Julia | 🚫 | 🚫 |
| Lua | 🚫 | 🚫 |
| PHP | 🚫 | 🚫 |
| Perl | 🚫 | 🚫 |
| Scala | 🚫 | 🚫 |