Mehrshad Farzaneh
Mehrshad Farzaneh

Reputation: 694

Put * before each line of comment in TypeScript file in VS Code IDE

I use VS Code and I want the comments that I write on several lines in Typescript language to be as follows (pay attention to the star character)

/**
 *@desc any text
 * any text
 */

But when I am writing a comment and I press enter, a star is not automatically created for the next line

/**
 *@desc any text
 any text
 */

So far, I have tested the following extensions on this date, but they did not solve this problem

  1. Auto Comment Blocks
  2. Comment Snippets
  3. Better Comment
  4. TSDoc Comment

Upvotes: 1

Views: 1828

Answers (3)

Mehrshad Farzaneh
Mehrshad Farzaneh

Reputation: 694

I installed JavaScript Comment Snippet (Visual Studio Code) extension And I did the following steps

Ctrl + Shift + P / ⇧ + ⌘ + P → Preferences: Open Settings (JSON)

And I set the following items in JSON file.

"editor.quickSuggestions": {
    "other": true,
    "comments": true,
    "strings": false
  },

And I restarted Visual Studio Code.

Now in your ts files your need write ///

Upvotes: 0

c.m.
c.m.

Reputation: 326

Look in the preferences of VS Code and activate JSDOC

Upvotes: 1

Thomas
Thomas

Reputation: 181745

It works (for me) if you put a space after the star, which is common practice anyway:

/**
 * @desc any text<Enter>
 * 
 ^^ This star and space inserted automatically.

Upvotes: 3

Related Questions