SassDoc / sassdoc

Release the docs!
http://sassdoc.com
MIT License
1.41k stars 56 forks source link

Parser error when using the @argument annotation #444

Closed tysongach closed 8 years ago

tysongach commented 8 years ago

I’m getting an when parsing SassDoc comments with the @argument annotation.

The SassDoc guides indicate that @argument is an alias for @parameter. However, if I use @argument in place of @parameter, I get this error:

[WARNING] Parser for annotation `argument` not found. Location: `_size.scss:3:29`

Here’s the documentation that I’m parsing:

/// Sets the `width` and `height` of the element in one statement.
///
/// @argument {number} $width
///
/// @argument {number} $height [$width]
///
/// @example scss
/// .first-element {
///   @include size(2em);
/// }
///
/// .second-element {
///   @include size(auto, 10em);
/// }
///
/// @example css
/// .first-element {
///   width: 2em;
///   height: 2em;
/// }
///
/// .second-element {
///   width: auto;
///   height: 10em;
/// }
///
/// @require {function} is-size

To clarify, if I swap @argument for @parameter, it works and I do not receive the warning. Even @param and @arg work just fine. It’s only when I use @argument, specifically.

KittyGiraudel commented 8 years ago

Apparently we omitted argument from the list of aliases: https://github.com/SassDoc/sassdoc/blob/master/src/annotation/annotations/parameter.js#L33. We should fix that. Ping @SassDoc/owners?

KittyGiraudel commented 8 years ago

Created a PR to address that: https://github.com/SassDoc/sassdoc/pull/445.

tysongach commented 8 years ago

Oh, @HugoGiraudel, you’re so fast. Do you sleep? :smile:

Thanks so much for your help, as always!

KittyGiraudel commented 8 years ago

Thank you for reporting this issue. I will wait for a review from owners and we’ll issue a patch. :)

tysongach commented 8 years ago

:+1:

KittyGiraudel commented 8 years ago

Version 2.1.20 released. Should fix your issue. :)

tysongach commented 8 years ago

Boom! Works like a charm.

Thanks @HugoGiraudel!

KittyGiraudel commented 8 years ago

You rock. :sparkles:

pascalduez commented 8 years ago

Thanks Hugo!

Which means we are lacking tests for aliases...