Wikunia / brackets-FuncDocr

FuncDocr generates JS/PHPDoc annotations for your functions
101 stars 14 forks source link

Default value setting has to be the first line #80

Closed kosinaz closed 8 years ago

kosinaz commented 8 years ago

I don't really know if this is a real issue, but as I see, if there is any code before the default value setting, the value won't appear in the comments. This can be very annoying in strict mode.

Working version:

/**
 * [[Description]]
 * @param {[[Type]]} [a=1] [[Description]]
 */
func = function (a) {
  if (typeof a === 'undefined') a = 1;
};

Current result:

/**
 * [[Description]]
 * @param {[[Type]]} a [[Description]]
 */
func = function (a) {
  'use strict';
  if (typeof a === 'undefined') a = 1;
};

Expected result:

/**
 * [[Description]]
 * @param {[[Type]]} [a=1] [[Description]]
 */
func = function (a) {
  'use strict';
  if (typeof a === 'undefined') a = 1;
};
kosinaz commented 8 years ago

Impressive response speed! And now this part works perfectly! Thank you!