junstyle / vscode-php-cs-fixer

PHP CS Fixer extension for VS Code
https://marketplace.visualstudio.com/items?itemName=junstyle.php-cs-fixer
MIT License
356 stars 45 forks source link

Format on save is not working #125

Open Younesi opened 4 years ago

Younesi commented 4 years ago

Hi, this is my VS code setting, and format on save is not working!

{
    "editor.accessibilityPageSize": 12,
    "editor.wordSeparators": "`~!@#%^&*()-=+[{]}\\|;:'\",.<>/?",
    "editor.fontSize": 16,
    "todo-tree.tree.showScanModeButton": false,
    "editor.rulers": [
        120
    ],
    "files.autoSave": "afterDelay",
    "[php]": {
        "editor.defaultFormatter": "junstyle.php-cs-fixer",
    },
    "php-cs-fixer.executablePath": "${extensionPath}/php-cs-fixer.phar",
    "php-cs-fixer.executablePathWindows": "C:/Users/User1/AppData/Roaming/Composer/vendor/bin/php-cs-fixer.bat", //eg: php-cs-fixer.bat
    "php-cs-fixer.onsave": true,
    "php-cs-fixer.rules": "@PSR2",
    "php-cs-fixer.config": ".php_cs;.php_cs.dist",
    "php-cs-fixer.allowRisky": false,
    "php-cs-fixer.showOutput": false,
    "php-cs-fixer.pathMode": "override",
    "php-cs-fixer.autoFixByBracket": true,
    "php-cs-fixer.autoFixBySemicolon": true,
    "php-cs-fixer.formatHtml": true,
    "php-cs-fixer.documentFormattingProvider": true,
    "php-cs-fixer.lastDownload": 1593875266622,
    "editor.formatOnSave": true,
    "git.autofetch": true,
    "diffEditor.ignoreTrimWhitespace": false,
    "tabnine.experimentalAutoImports": true,
} 

I have to press ctl + s I have installed PHP-CS-Fixer globally via Composer

bilogic commented 4 years ago

Same here, I installed only the extension v0.1.157 on VSCode 1.50.1

loureirorg commented 2 years ago

Same here, v0.3.6. When I close and re-open VSCode, it works for a few seconds, and then it stops working.

I tried deleting the settings.json file and reinstalling the plugin without luck.

As a temporary solution, I switched to a different plugin ("PHP CS Fixer" by "mansoorkhan96").