Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format On Save not working on VSCODE (Windows 10) #1640

Closed
jbersamin-vitech opened this issue Feb 4, 2021 · 2 comments
Closed

Format On Save not working on VSCODE (Windows 10) #1640

jbersamin-vitech opened this issue Feb 4, 2021 · 2 comments

Comments

@jbersamin-vitech
Copy link

I tried to search on close/open issues but no avail.

What is wrong with my settings? Please help. Thanks

Prettier 2.2.1

PHP Plugin 0.16.1

package.json

    "devDependencies": {
        "@prettier/plugin-php": "^0.16.1",
        "axios": "^0.21",
        "laravel-mix": "^6.0.6",
        "lodash": "^4.17.19",
        "postcss": "^8.1.14",
        "prettier": "^2.2.1"
    }

.prettierrc.json:

{
    "useTabs": true,
    "overrides": [
        {
            "files": ["*.p"],
            "options": {
                "parser": "php",
                "phpVersion": "7.4",
                "braceStyle": "1tbs",
                "embeddedLanguageFormatting": "off",
                "singleQuote": true
            }
        }
    ]
}

My VS Code Settings:

    "editor.formatOnSave": false,
    "[php]": {
        "editor.formatOnSave": true,
        "editor.formatOnPaste": true
    },
    "editor.defaultFormatter": "esbenp.prettier-vscode",

Expected behavior:

@nicoder
Copy link
Contributor

nicoder commented Feb 5, 2021

hi @jbersamin-vitech ,

(I don't know much about this but) this line of your .prettierrc.json stood out to me:

"files": ["*.p"],

should it be *.php ?

(or maybe your php files have a .p extension)

@jbersamin-vitech
Copy link
Author

@nicoder I tried to change it to .php and still not working. If I could just see any errors in the output inside the VSCODE. I could have fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants