-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
No parser could be inferred for file when using Prettier Java with pnpm #508
Comments
Hi @NatoBoram ! This seems to be an issue with how Prettier resolves plugin that is not compatible with pnpm (see this issue and this one). A workaround seems to be explained in this issue, especially in this comment: sveltejs/prettier-plugin-svelte#155 (comment) Can you try and see if it solves your issue ? If so, let's improve our documentation :) |
I'm closing this as we don't have any update on this. If you have anything new to share with us, feel free to comment and we can reopen the issue. |
I've given up and gone back to google's code formatter |
I'm having same issue
@clementdessoude could we reopen this? |
Hello @jmayday, I'm not opposed to reopening this issue, but as explained in this previous comment, I am waiting for some information.
Furthermore, could you provide a bit more information on how you installed prettier and prettier-plugin-java ? Do you also use pnpm ? |
Hey @clementdessoude, I didn't really know how to apply hints from the other issue. I just downgraded Prettier to version 2.8.8 and it works again. |
Hi! Just ran into this issue with Installed prettier and prettier-plugin-java locally:
Then went over to the svelte issue and tried the options
Final solutions are:
Hope this helps! |
I can confirm that I have this now running successfully in VSC with the standard Prettier VSC extension! |
FYI prettier 3.0 indeed changed its behavior regarding plugins, and don't search and load them automatically anymore: Plugin search feature has been removed |
Hey @TyIsI |
It's a top-level configuration item. In my YAML file, I have it as so:
|
In my project root, I have created a file for prettier config called:
In there I have added the plugins:
Taking special note of the formatting for yaml with indentation of plugins list. This all works fine now, I am using:
|
Hello everyone 👋! I use null-ls to format my files (this repository was archived). Everything was fine until the .astro files don't work (same problem), even though .prettierrc.config.js exists:
I solved it by opening VSCode and installing the Astro plugin, I would like to solve it in NeoVim 😿 |
@jeremy-brooks, thank you for your answer! It led me to solving my problem. I want to add my issue resolution here in case anyone else finds themselves on this thread because of the same random error message. I just updated my version of Ends up the change from |
I faced the same issue in CI pipeline of jhonline repo.
|
We have a shared Prettier configuration we use as a base configuration. We need to add support for Java in some cases. Here is an example of our base configuration with added support for Java using this plugin in ESM. Confirmed this works with the esbenp.prettier-vscode plugin. import prettierBaseConfig from '@example/prettier';
const prettierConfig = {
...prettierBaseConfig,
plugins: ['prettier-plugin-java']
};
export default prettierConfig; |
The only solution that works for me, on Windows, is to include the full path to the plugin :
|
The installation instructions don't seem to work on my end.
prettier-plugin-java@1.4.0
# Options (if any):
Input:
Output:
Expected behavior:
The text was updated successfully, but these errors were encountered: