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

Not working with PHP plugin? #612

Closed
antonioribeiro opened this issue Oct 27, 2018 · 4 comments
Closed

Not working with PHP plugin? #612

antonioribeiro opened this issue Oct 27, 2018 · 4 comments
Labels
locked Please open a new issue and fill out the template instead of commenting.

Comments

@antonioribeiro
Copy link

antonioribeiro commented Oct 27, 2018

This is how I'm installing it:

$ npm install prettier @prettier/plugin-php --save-dev
+ prettier@1.14.3
+ @prettier/plugin-php@0.9.0

Looks like the plugin is working for javascript:

"editor.formatOnSave": false,

"[javascript]": {
    "editor.formatOnSave": true,
    "editor.formatOnPaste": true
},

But not for PHP:

"[php]": {
    "editor.formatOnSave": true,
    "editor.formatOnPaste": true
},

The strangest is that when I save this PHP file:

<?php

return [
    /*
    |--------------------------------------------------------------------------
    | Default Queue Connection Name
    |--------------------------------------------------------------------------
    |
    | Laravel's queue API supports an assortment of back-ends via a single
    | API, giving you convenient access to each back-end using the same
    | syntax for every one. Here you may define a default connection.
    |
    */

    'default' => env('QUEUE_CONNECTION', 'sync'),

Nothing but the docblock changes:

<?php

return [
    /*
    |--------------------------------------------------------------------------
    | Default Queue Connection Name
    |--------------------------------------------------------------------------
    |
    | Laravel's queue API supports an assortment of back-ends via a single
    | API, giving you convenient access to each back-end using the same
    | syntax for every one. Here you may define a default connection.
    |
*/ <============ THIS IS WHAT IT CHANGES IN THE FILE

    'default' => env('QUEUE_CONNECTION', 'sync'),

But, still, running it manually, it works fine:

prettier --write config/queue.php
@CiGit
Copy link
Member

CiGit commented Nov 8, 2018

We currently have no plugin support. see #395
It should (I've not tested) work if you install it in this extension's folder
$HOME/.vscode/extensions/esbenp.prettier-vscode-VERSION/

It seems you have an extension which does something to your php file if it changes when you Format Document (you should do it without saving as a lot of other things can kick in onSave)

esamattis added a commit to esamattis/prettier-vscode that referenced this issue Mar 17, 2019
esamattis added a commit to esamattis/prettier-vscode that referenced this issue Mar 17, 2019
@ntotten
Copy link
Member

ntotten commented Aug 12, 2019

Duplicate of #899

@ntotten ntotten marked this as a duplicate of #899 Aug 12, 2019
@ntotten ntotten closed this as completed Aug 12, 2019
@antonioribeiro
Copy link
Author

I understand your Pull Request is fixing this Issue, but one cannot be a duplicate of the other, they are complementary: a change in the code is done to fix an issue.

But all right, thanks for the fix.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot added the locked Please open a new issue and fill out the template instead of commenting. label Apr 12, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants