Comments Block - VSCode

1

There is something that can make it easier to create comment blocks in this format:

 /*
|--------------------------------------------------------------------------
| Register Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users as well as their
| validation and creation. By default this controller uses a trait to
| provide this functionality without requiring any additional code.
|
*/

Block used in several Laravel Core files.

    
asked by anonymous 09.03.2018 / 23:06

1 answer

2

I have two answers for you, the first is easier, but may not be exactly what you need.

With the Laravel Blade Snippets plugin you can do as in this image. link

NOTE:ThereareotheroptionsintheVSCodeMarketplace,seethefollowinglink: link

Now the second option, but that will give you a better control of what you want.

For this you will create a custom Snippet in Global Snippts as in the image below.

InthisfileyouwillcreateyourCustomCommentBlock.Andmakeashortcutthatwheneveryoutypewillappearthewholeblockatonce(asintheimageofthePluginIquoted)

Yourblockcanbethatwayforexample.Theshortcuttopastetheblockintothepageis"prefix": "coment-laravel", see below

"Bloco de comentário Laravel": {
    "prefix": "coment-laravel",
    "body": [
        "/*",
        "|--------------------------------------------------------------------------",
        "| ${0:Page Title}Register Controller",
        "|--------------------------------------------------------------------------",
        "|",
        "| ${1:Page Title}This controller handles the registration of new users as well as their",
        "| validation and creation. By default this controller uses a trait to",
        "| provide this functionality without requiring any additional code.",
        "|",
        "*/"
    ],
    "description": "Bloco de comentário Laravel"
}

The official documentation on how to use the VS Code Snippets you can find here: link

    
10.03.2018 / 17:06