tree-sitter-phpdoc
tree-sitter-phpdoc copied to clipboard
we require return types in @method tags, but phpstan does not
Noticed while using Zed w/ this docblock:
/**
* @method getSelectorContents(string $selector)
* @method getSelectorAttribute(string $selector, string $attribute)
* @method getTrimmedString(string $string)
*/
phpstan does fine with this, but the highlighting was messed up in Zed. The issue is that we are requiring a return type for @method, so the above resulted in a parse error, but phpstan seems to not care if one exists or not.
This snippet was colored correctly:
/**
* @method DOMNodeList getSelectorContents(string $selector)
* @method string getSelectorAttribute(string $selector, string $attribute)
* @method string getTrimmedString(string $string)
*/
Suggestion: make return type optional to match behavior of phpstan.