Closed mikehaertl closed 2 years ago
Yes, this makes sense for the moment. @var
requires a variable name, so leaving it out means tree-sitter will not recognize that tag and generate a parse error. The phpDoc docs for @var
state
The @var tag MUST contain the name of the element it documents. An exception to this is when a declaration only refers to a single property or constant. In that case, the name of the property or constant MAY be omitted.
And I have implemented this for the former, not the latter. psalm
and phpstan
also encourage/allow the element name to be omitted, and I have some local changes that support that, but they're not pushed yet.
I believe that this is now fixed in f54431c. Thanks!
Confirmed. Thanks for the quick fix.
If
@var
is not followed by a variable name (like in a property declaration in a class) the description is not parsed as@text
but as comment:This gets especially weird if the description contains linebreaks: