skip to Main Content

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

3

Answers


  1. Chosen as BEST ANSWER

    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 ///


  2. 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.
    
    Login or Signup to reply.
  3. Look in the preferences of VS Code and activate JSDOC

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search