Skip to content

Commit

Permalink
feat: supports PHP (#634)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Meng Zhang <[email protected]>
  • Loading branch information
3 people authored Oct 26, 2023
1 parent 6e59aa8 commit 688e7d7
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 1 deletion.
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.

28 changes: 28 additions & 0 deletions crates/tabby-common/assets/languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
1 change: 1 addition & 0 deletions crates/tabby-scheduler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
11 changes: 11 additions & 0 deletions crates/tabby-scheduler/src/dataset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,17 @@ lazy_static! {
.unwrap(),
),
),
(
"php",
TagsConfigurationSync(
TagsConfiguration::new(
tree_sitter_php::language(),
tree_sitter_php::TAGS_QUERY,
"",
)
.unwrap(),
),
),
])
};
}
2 changes: 1 addition & 1 deletion website/docs/programming-languages.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 | 🚫 | 🚫 |

0 comments on commit 688e7d7

Please sign in to comment.