Giter Club home page Giter Club logo

Comments (7)

czosel avatar czosel commented on June 19, 2024 3

Hi @mermshaus, thanks for the bug report! It seems that plugins now have to be registered explicitly, e.g. by passing --plugin=@prettier/plugin-php. See here for details and alternatives. We'll have to update our docs to reflect this.

@fisker has the implicit plugin registration been dropped?

from plugin-php.

fisker avatar fisker commented on June 19, 2024 3

The plugin search feature has been removed.

from plugin-php.

mermshaus avatar mermshaus commented on June 19, 2024 2

@coffebar Yes, it still works for me. To avoid derailing this issue, I put more info here. I hope it may be of help to you.

from plugin-php.

mermshaus avatar mermshaus commented on June 19, 2024 1

Hi everyone,

thanks for the quick help! Adding the plugin configuration/CLI arguments solves this issue.

There is one thing of note: If you have a global installation of prettier, plugin configuration wonโ€™t work (right now), at least not by simply specifying the package name. Itโ€™s possible to use an absolute path to a pluginโ€™s entry point to work around this. E.g. prettier --plugin /usr/lib/node_modules/@prettier/plugin-php/src/index.js.

from plugin-php.

coffebar avatar coffebar commented on June 19, 2024 1

@mermshaus I have tried your workaround with plugin-php and I see the error message is gone, but it's not gonna work: no formatting.
Is it still work for you?

test.php

<?php
if(1 ){ echo 2;  }
?>
prettier --log-level debug test.php \
  --plugin /home/abc/.node_modules/lib/node_modules/@prettier/plugin-php/src/index.js \
  --parser php

Output:

[debug] normalized argv: {"":["test.php"],"cache":false,"color":true,"editorconfig":true,"logLevel":"debug","plugins":["/home/abc/.node_modules/lib/node_modules/@prettier/plugin-php/src/index.js"],"parser":"php","configPrecedence":"cli-override","debugRepeat":0,"ignorePath":[".gitignore",".prettierignore"],"_":["test.php"],"__raw":{"_":["test.php"],"cache":false,"color":true,"editorconfig":true,"log-level":"debug","plugin":"/home/abc/.node_modules/lib/node_modules/@prettier/plugin-php/src/index.js","parser":"php","config-precedence":"cli-override","debug-repeat":0,"ignore-path":[".gitignore",".prettierignore"]}}
[debug] resolve config from '/home/abc/test.php'
[debug] loaded options `{"parser":"php","plugins":["/home/abc/.node_modules/lib/node_modules/@prettier/plugin-php/src/index.js"],"useTabs":false,"tabWidth":2}`
[debug] applied config-precedence (cli-override): {"parser":"php","plugins":["/home/abc/.node_modules/lib/node_modules/@prettier/plugin-php/src/index.js"],"tabWidth":2,"useTabs":false}
<?php
if(1 ){ echo 2;  }
?>

from plugin-php.

mjsteinbaugh avatar mjsteinbaugh commented on June 19, 2024

@coffebar Specifying the full plugin path works for me, but I find this to be an annoying regression as this wasn't required previously with prettier v2

from plugin-php.

felixmosh avatar felixmosh commented on June 19, 2024

Downgraded to v2 since phpStorm uses global prettier & php plugin instances ๐Ÿ‘Ž๐Ÿผ

from plugin-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.