google / tern-closure

A Tern plugin adding Closure support.
Apache License 2.0
33 stars 18 forks source link

Support optional argument types #19

Open jgiles opened 10 years ago

jgiles commented 10 years ago

Example:

/** @param {ParamType=} opt_param */
var fnOptParam = function(opt_param) {
  opt_param; //: ParamType=
};
fnOptParam; //: fn(opt_param: ParamType=)

Note: This is separate from nullability information. The Tern doc_comment plugin modifies the displayed parameter names in order to surface this information. Ideally, it would be part of the type information attached to the parameter.