HookyQR / VSCodeBeautify

Enable js-beautify (https://github.com/beautify-web/js-beautify) in VS Code
MIT License
606 stars 180 forks source link

PHP blade syntax produces error after format "->" becomes "- >" #282

Closed amitshahc closed 5 years ago

amitshahc commented 5 years ago

NOTE: Please provide code snippets instead of screen shots. Your issue needs to be replicated, and we need the failing code (text) to do this.

Provide the settings you use: (VS Code workspace and user settings, .jsbeautifyrc, .editorconfig) eg.: VS Code:

{
    "editor.formatOnSave": true
}

.jsbeautifyrc

{
    "max_preserve_newlines": 2,
    "preserve_newlines": true,
    "end_with_newline": true,
    "brace_style": "collapse-preserve-inline",
}

Action performed

Format html file with HookyQR.beautifyFile command F1 + Beautify file + HTML

Expected results

Expected ... to ... @foreach($employee -> services as $service) // Before: the blade php code in html template

Actual results

Details of what happened ... @foreach($employee - > services as $service) // After: Blade php syntax error..

johnnymatthews commented 5 years ago

I believe there's an extension you can get for Blade files. Take a look at this StackOverflow answer. It looks like you have to install Laravel Blade Snippets.

HookyQR commented 5 years ago

Try with the latest version. Seems to workout fine now. ;)

HookyQR commented 5 years ago

WOMM and no response from Issue opener.