What’s The Best Way To Write Multi-Line Code Snippets In VS-Code?

You can define the body of your snippet as an array of strings, each beginning on a new line.

Like this:

  "Create for loop":{
    "prefix": "mkfor",
    "body":[
      "for(int i = 0; i < 3; i++)",
      "{",
      "   //code goes here",
      "}"
    ],
   "description": "Creates a for loop"
  }

or if you install Easy Snippet Maker extension, you can create your snippets by highlighting texts.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)