claytonrcarter / tree-sitter-phpdoc

PHPDoc grammar for tree-sitter
22 stars 11 forks source link

FR: support variadics with @param #26

Open Whax opened 1 year ago

Whax commented 1 year ago

Hello,

I'm on neovim using treesitter and I'm encountering the following issue :

image

As you can see, the Variadic param type is not correctly recognized. It's considered as @spell

image

instead of @type.phpdoc

image

claytonrcarter commented 2 months ago

The @spell part is coming from neovim; that's not something that is added or related this grammar. I can confirm, though, that variadic params aren't supported. (In this case, ...$attributes is being parsed as if it were a description of the param, which is probably why neovim is saying that it needs spellchecking (I assume that's what @spell if for).)

I would welcome a PR that adds support for variadic params.