pavlitsky / vscode-yard

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

Order in params documentation #7

Closed Mziserman closed 4 years ago

Mziserman commented 5 years ago

Hello,

It seems to me the correct order is @param #{param_name} [#{type}] #{description}

while this plugin generates @param [#{type}] #{param_name} #{description}.

Am I wrong ? I got this from https://www.rubydoc.info/gems/yard/file/docs/Tags.md#Hashes for example.

pavlitsky commented 5 years ago

@Mziserman I believe these are both legit and it's up to implementation which one to use.

Item 3 here https://www.rubydoc.info/gems/yard/file/docs/Tags.md#Common_Tag_Syntaxes says:

..name key, placed either before or after the types list.

Moreover, on that page they use both syntaxes too:

@param [String] username the username to quit

as well as

@param user [String] the username for the operation

I chose the type-before-name syntax as it seemed more common to me, the other one may have its benefits too. Maybe we should have a setting for this?

Mziserman commented 5 years ago

Ho yes you are right, thanks for pointing me to the right place in the doc.

Maybe we should have a setting for this?

Don't do it on my account, I'm happy to use "[type] name description" if it's a valid format.

Thanks for the quick clarification !

olbrich commented 4 years ago

I would like to see this as an option.

pavlitsky commented 4 years ago

Done. Set yard.tags.paramNameBeforeType to true to make extension use name-before-type variant.