-
Notifications
You must be signed in to change notification settings - Fork 42
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
VSCode Prettier Plugin required settings modification to continue working #1168
Comments
Hello, thanks for opening this bug ticket. I think I need more info on your particular case, I've tried using your git clone https://github.com/dangmai/ppa-1168.git
cd ppa-1168
npm ci
npx prettier src/AnonymousApex.apex Some thing I do notice: it looks like you're trying to format |
Thanks for taking the time to help troubleshoot. I didn't fully explain I am having issues within vscode, configured to format upon save. The error I received occurs if I run Format Document from the command pallet. When I test your ppa and attempt the same on the AnonymousApex.apex file I receive There is no formatter for 'apex-anon' files installed. If I clone your ppa repo and run the last command I don't receive any error, but if I edit the AnonymousApex.apex file with additional lines and run the command the extra lines are not removed. Again, much appreciated for your help. |
Thank you very much for the context, I can reproduce that in VSCode now. This is related to this bug ticket on the Prettier VSCode extension: prettier/prettier-vscode#3235 Could you try the workaround there and see if it resolves your issue? (either downgrading to Prettier 3.1.0 or configuring There's not much I can do about this particular issue in this repo, since it's a VSCode thing, but I'll keep this issue opened for now in case other folks run into the same thing. I'm hoping that it will be fixed in the VSCode plugin repo. |
Bingo, that fixed it! Thank you for tracking down and sharing the bug/fix. |
The fix with adding path to prettier config to |
Thanks this worked for me! So that future viewers with this issue don't have to navigate to the Prettier VSCode repo for workaround -- here is the line: Try adding |
For whatever reason, @mplunket 's solution didn't work for me until I added this to my
|
Wanted to point that on the Prettier Plugin for Apex page you can find this line is required. |
Looks like the upstream ticket in the Prettier VSCode repo has now been fixed, so I'm closing this issue as well. Thanks for all the workarounds everyone! |
This plugin has been working, but earlier this week it stopped. As far as I can tell, nothing has changed in the .prettierrc or package.json files. Prettier will format json and js files, but states There is no formatter for 'apex' files installed.
package.json
.prettierrc
Thank you for your assistance.
Additional information (please fill this out):
The text was updated successfully, but these errors were encountered: