Comments Block - Vscode

Asked

Viewed 2,921 times

1

There is something that can facilitate the creation of 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.

  • 1

    https://marketplace.visualstudio.com/items?itemName=karyfoundation.comment

  • @Virgilionovic thank you very much!

  • Young lady if my answer solved your problem, consider branding it as asseita by clicking on , so we keep the site organized with accepted and answered questions.

1 answer

2


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

With the plugin Laravel Blade Snippets you can do as in this picture. https://marketplace.visualstudio.com/items?itemName=onecentlin.laravel-blade

inserir a descrição da imagem aqui

NOTE: In the VS Code Marketplace there are other options, see more in the link: https://marketplace.visualstudio.com/search?term=comment&target=VSCode&category=All%20categories&sortBy=Relevance


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

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

inserir a descrição da imagem aqui

In this file you will create your Custom Block Comment. And make a Shortcut that whenever you type will appear the whole block at once (as in the image of the plugin I mentioned)

Your block can be that way for example. The shortcut to paste the block into the page is "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 using VS Code snippets you can find here: https://code.visualstudio.com/docs/editor/userdefinedsnippets

  • Gratitude Hugo! Sensational the creation of the snippet, I will create for everything now! haha

  • Very good is!! I use a lot, for HTML and CSS, I have some that make an entire Bootstrap template for example rss

  • I wore something like this in Sublime but I did not find ready for Vscode, I remember that there was something like bs3:modal and he created the modal with the button, everything in the scheme.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.