microsoft / vscode-comment

Adds simple jsdoc comments for the parameters of a selected function signature
Other
72 stars 36 forks source link

TypeScript constuctors not fully supported #15

Open truhlikfredy opened 7 years ago

truhlikfredy commented 7 years ago

The regular constructors work, but the shorthand constructors create issues, input:

class Experiment {

  constructor(public  lines:           string[],
              private alignSymbols:    number,
              private firstSymbolOnly: boolean) {

  }  
}

Will cause the "add doc" command create this:

  class Experiment {
  /**
   * @param  {string[]} publiclines
   * @param  {number}   privatealignSymbols
   * @param  {boolean}  privatefirstSymbolOnly
   */
  constructor(public  lines:           string[],
              private alignSymbols:    number,
              private firstSymbolOnly: boolean) {

  }  
}

Notice the public/private are now part of a field name in the auto-generated documentation.