How to have a good identation of . Blade in Vscode?

Asked

Viewed 403 times

0

Example of expected result:

<body>
    @extends('t')
    @include('as')
</body>

Example of Reality with PHP extension

<body>
    @extends('t') @include('as')
</body>
  • 1

    Dude, you don’t wear something like that! https://marketplace.visualstudio.com/items?itemName=onecentlin.laravel-blade I don’t think VS Code understands that it has to break the line always before a @

  • @hugocsl I use this, it helps quite a lot. I want to see if anyone has managed to solve this beyond the extensions

  • Are you using an extension for Blade ?

  • I am only for snippets https://marketplace.visualstudio.com/items?itemName=onecentlin.laravel-blade

  • @Daviddias thinks to me, why do you have to jump a line if you have to write the Pledge within parentheses ? and another to type another command from a enter, that’s not it!

  • @Thank you for your reply. Actually the problem is not exactly in writing, the problem is when you run the automatic ident to align everything, just as I do with PHP, understand? In the case of PHP, it already frames everything for PSR-2 and looks beautiful

  • What are the commands to do this?

  • See here: https://github.com/Dickurt/vscode-php-formatter

  • is very practical, everything is standardized and comfortable to work with

  • But this for PHP. I’m using just for example, the goal is to solve the question for Blade

  • I even managed to make it work, but what’s in your question are extends and include, the extends by default sticks to the side of the code. and in fact it does not make correct all tags the plugin does not have all the features, I believe that opening an Issue in your package is ideal

  • Open an Issue here explaining problem: https://github.com/onecentlin/laravel-blade-snippets-vscode/issues !

  • @Virgilionovic but this package only does the snippets from what I’ve seen, it’s not current when we do the auto identation

  • It has in its description formatting! I have read the documentation, but, it is the key association measure, now it is not ideal, open Issue that is better expose your problem in the developer himself!

  • @Virgilionovic great, but the idea of this question is to see if anyone has solved it in any way, not exactly with this extension, was just an example. Thank you anyway :)

  • So if you need to understand the following that from what I could search not yet any plugin, there is one that does not format the way you want, so here is a way maybe someone know, but, I sincerely use the formatting of the editor itself, for such and satisfy me, open an Issue is of great value to you and to others, then you come here and put as an answer, but, .blade for Laravel few stir and the Laravel community that I participate also does not know ... the idea of packages is to open corrections goes there and also try there!

  • 1

    Excellent @Virgilionovic, I’ll do it

Show 12 more comments
No answers

Browser other questions tagged

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