mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 19:30:02 -04:00
parsers: add phpdoc parser (experimental)
This commit is contained in:
parent
d0158c053d
commit
d7c4ae886d
3 changed files with 54 additions and 1 deletions
|
|
@ -245,6 +245,17 @@ list.php = {
|
||||||
maintainers = { "@tk-shirasaka" },
|
maintainers = { "@tk-shirasaka" },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
list.phpdoc = {
|
||||||
|
install_info = {
|
||||||
|
url = "https://github.com/claytonrcarter/tree-sitter-phpdoc",
|
||||||
|
files = { "src/parser.c" },
|
||||||
|
-- parser.c in the repo still based on TS 0.17 due to other dependencies
|
||||||
|
requires_generate_from_grammar = true,
|
||||||
|
generate_requires_npm = true,
|
||||||
|
},
|
||||||
|
experimental = true,
|
||||||
|
}
|
||||||
|
|
||||||
list.java = {
|
list.java = {
|
||||||
install_info = {
|
install_info = {
|
||||||
url = "https://github.com/tree-sitter/tree-sitter-java",
|
url = "https://github.com/tree-sitter/tree-sitter-java",
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
(text) @html
|
(text) @html
|
||||||
|
|
||||||
(comment) @comment
|
(comment) @phpdoc
|
||||||
|
|
|
||||||
42
queries/phpdoc/highlights.scm
Normal file
42
queries/phpdoc/highlights.scm
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
(tag_name) @attribute
|
||||||
|
(tag
|
||||||
|
(tag_name) @_tag (#eq? @_tag "@param")
|
||||||
|
(variable_name) @parameter
|
||||||
|
)
|
||||||
|
(tag
|
||||||
|
(tag_name) @_tag (#eq? @_tag "@property")
|
||||||
|
(variable_name) @property
|
||||||
|
)
|
||||||
|
(tag
|
||||||
|
(tag_name) @_tag (#eq? @_tag "@var")
|
||||||
|
(variable_name) @variable
|
||||||
|
)
|
||||||
|
(tag
|
||||||
|
(tag_name) @_tag (#eq? @_tag "@method")
|
||||||
|
(name) @method
|
||||||
|
)
|
||||||
|
(parameter
|
||||||
|
(variable_name) @parameter)
|
||||||
|
(type_list
|
||||||
|
[
|
||||||
|
(array_type)
|
||||||
|
(primitive_type)
|
||||||
|
(named_type)
|
||||||
|
] @type)
|
||||||
|
(tag
|
||||||
|
(description (text) @text))
|
||||||
|
(tag
|
||||||
|
[
|
||||||
|
(author_name)
|
||||||
|
(version)
|
||||||
|
] @text)
|
||||||
|
(tag
|
||||||
|
(email_address) @text.uri
|
||||||
|
)
|
||||||
|
|
||||||
|
[
|
||||||
|
"$"
|
||||||
|
">"
|
||||||
|
"<"
|
||||||
|
"|"
|
||||||
|
]@keyword
|
||||||
Loading…
Add table
Add a link
Reference in a new issue