Open Obka opened 6 years ago
@Obka Do you add "blade.format.enable": true,
to your user settings?
@onecentlin Yes i add in setting .
@Obka Do you save the file as *.blade.php
, and it's not just untitled unsaved file.
@onecentlin yes i have an *blade.php and saved the file ...
@Obka Is there any other blade relative extensions you installed? I cannot reproduce your issue.
Also please make sure you are in Laravel Blade
language mode.
@onecentlin i'm sure not installed any extensions for laravel or php !
i use Laravel Blade
in my editor language .
However thank for answer.
@Obka Try to install new version just released v1.18.0, and see if it works, thanks.
@onecentlin Thank you so much my problem is solved .
in version 1.18.0, this extension will add break everytime I run format. which can cause my code to be wasting space.
@onecentlin
@adrianriyadi Sorry for the inconvenient. The auto format for blade is still way too many to improve.
then we'll very glad if you can improve and fix that soon :+1: @onecentlin
For anyone coming across this issue, when changing your user settings, don't forget to restart your VSCODE, or else, it simply won't take effect - I don't know if that's another issue though :p
Using Version 1.26.0-insider on MAC.
Thank you @onecentlin for the hard work! I appreciate really!
Désolé mais je vais répondre en français. J’ai résolus ce problème au niveau de files.associations dans la config Il suffit de faire ".blade.php":"blade" au lieu de ".blade.php":"html". En espérant que ça va aider.
This worked for me 😉
"blade.format.enable": true,
"files.associations": {
"*.php": "php"
},
Hello, I use ALT+SHIFT+F in html file for format my code , now in blade.php when i press this shortcut key nothing happens how can i fix this ?
Thnak you.
you should go to setting and enable blade.format
I've enabled blade format code. "blade.format.enable": true
. Then, I restart VS. When I format the document, all of the lines are aligned to the left – no indentation.
All of my files end in *.blade.php. I'm using the Sage Wordpress theme.
As @n3omaster n3omaster mentioned above:
"files.associations": { "*.php": "php" },
This does not work for me. The blade document will turn into a regular php document after restarting and lose all blade syntax highlighting and the ability to use Blade snippets.
I do not have any other formatters installed. VS 1.40.0; Laravel Blade Snippets 1.20.0
Are you added the extension in vscode? this is the link for extension exension laravel blade you after add in setting.json
"emmet.triggerExpansionOnTab": true, // enable tab to expanse emmet tags
"blade.format.enable": true, // if you would like to enable blade format
"emmet.includeLanguages": {
"blade": "html"
},
now you restart you vscode, it works for me
Same issue as @djmtype - html in blade file gets formatted, but blade directives ("@") are all left-aligned with no indentation when executing format. I suspect there is difficulty for the parser to understand when both html and blade directives need formatting mixed together. blade.format.enable is true in settings, and am not setting file associations .php to php as that removes separate functionality specific to .blade.php files (as was mentioned). Answer from @andremartds did not work for me. Somewhere else someone mentioned perhaps something like this is needed, but for blade: https://github.com/Microsoft/vscode/blob/72ea2ad8673b07d1432cff1f0ec52ca7ec37526c/extensions/html/client/src/htmlMain.ts#L119
Any news with this? Still a problem here. I really don't want to use beautify for this.
@onecentlin Ping! Could you look into this, or point us in the right direction to try fixing this?
Change your default formatter to none
Hello i got the same problem with the formatter
i have this in the configuration
"bladeFormatter.format.useTabs": true, "blade.format.enable": true, "bladeFormatter.format.sortTailwindcssClasses": true
this is a prompt shown when i pressed CTRL + ALT + F
Hello, I use ALT+SHIFT+F in html file for format my code , now in blade.php when i press this shortcut key nothing happens how can i fix this ?
Thnak you.