简体   繁体   English

Laravel 刀片更漂亮的格式,但删除了语法高亮和片段

[英]Laravel blade prettier formatting but removed the syntax highlighting and snippets

I added *.blade.php as html in the files.associations to have prettier format for my blade.php files but this results to remove the snippets and highlighting needed in the blade.php files.我在files.associations添加了*.blade.php作为 html,以便为我的blade.php文件提供更漂亮的格式,但这导致删除了blade.php文件中所需的片段和突出显示。 I'm using Prettier for my formatting and Laravel Blade Snippets for my highlighting and snippets.我使用 Prettier 进行格式化,使用 Laravel Blade Snippets 进行突出显示和片段。 Is there any other way to format blade files as html but keep the snippets and highlighting?有没有其他方法可以将刀片文件格式化为 html 但保留片段和突出显示?

With *.blade.php in files.associations*.blade.php中使用*.blade.php files.associations 在此处输入图片说明

without *.blade.php in files.associationsfiles.associations没有*.blade.php files.associations 在此处输入图片说明

I had the same issue.我遇到过同样的问题。 The only thing that works for me was:唯一对我有用的是:

  • Install this extension: Laravel Blade安装这个扩展: Laravel Blade

  • Add in settings.jsonsettings.json添加

     "[blade]": { "editor.defaultFormatter": "amirmarmul.laravel-blade-vscode", "editor.formatOnSave": true }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM