pavlitsky / vscode-yard

YARD comments generator for Visual Studio Code
https://yardoc.org/
MIT License
23 stars 3 forks source link

Wrong syntax for @!attribute #5

Closed qortex closed 5 years ago

qortex commented 5 years ago

The YARD documentation states that:

@!attribute [r | w | rw] attribute_name
   Indented attribute docstring

Note: This directive should only be used if there is no explicit attr_* declaration for the attribute in > any source files (i.e., the attribute is declared dynamically via meta-programming). In all other cases, add documentation to the attribute declaration itself.

The correct documentation for an attribute thus looks like:

# @return [MissionType] Mission to work with
attr_reader :mission

And indeed it works well with Yard.

But the extension generates this comment:

# @!attribute [r] mission
#   @return [MissionType] Mission to work with
attr_reader :mission

And this is not understood by Yard.

Would it be possible to update the snippet in this sense?

Thanks for the very useful work!

pavlitsky commented 5 years ago

@MicMicMon I missed that Note in the documentation, unfortunately. I'll release an update to fix this, thank you for your report!

qortex commented 5 years ago

Great, thanks!