vscode-custom-local-formatters icon indicating copy to clipboard operation
vscode-custom-local-formatters copied to clipboard

Wrong formatter when saving `.blade.php`

Open bilogic opened this issue 2 years ago • 1 comments

Hi,

    "[blade]": {
        "editor.defaultFormatter": "jkillian.custom-local-formatters"
    },
    "[php]": {
        "editor.defaultFormatter": "jkillian.custom-local-formatters"
    },
    "customLocalFormatters.formatters": [
        {
            "command": "/var/www/stdin-blade-stdout.sh",
            "languages": [
                "blade"
            ]
        },
        {
            "command": "/var/www/stdin-pint-stdout.sh",
            "languages": [
                "php"
            ]
        }
    ],
  1. I need to format 2 types of files, .blade.php and .php
  2. They are known to VSCode as blade and php
  3. But when I save on .blade.php files, stdin-pint-stdout.sh gets executed instead

Any ideas why? Thank you!

bilogic avatar May 21 '23 22:05 bilogic

I found the issue.

I uninstalled the other blade formatters and it caused the blade language to disappear. The fix was to reinstall one of them. Perhaps allowing users to add define their own languages can be part of this package, although it doesn't seem possible from my quick glance of the VSCode docs. :)

bilogic avatar May 21 '23 22:05 bilogic

Thanks for documenting this issue in case others hit it! I'm going to close this out for now because I don't think there's anything else actionable.

jkillian avatar Jan 30 '25 04:01 jkillian