There is no formatter for 'apex' files installed

See original GitHub issue

I followed the directions in https://developer.salesforce.com/tools/vscode/en/user-guide/prettier

I am able to run the commands you listed prettier --debug-check "/path/to/project/**/*.{trigger,cls}" in the readme and it does format all my classes and is working fine. But I can’t trigger a manual format of a document after that, and even though I have the format on save setting enabled it doesn’t do anything on save.

When I try to manually format a class (shift option F) I get the error message that. There is no formatter for ‘apex’ files installed. My Editor:Default Formatter setting is set to esbenp.prettier-vscode.

Is this plugin supposed to be compatible for format on save and manual formatting? It’s working as expected when I run the commands in terminal, but not in other cases I’d use daily.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dangmaicommented, Oct 15, 2020

I totally understand. Prettier Apex can be used both globally and locally, but the VSCode Prettier extension is a separate project to this and it has its own assumption about the location Prettier Apex can be installed.

I’ll close this ticket for now, feel free to ask more questions if you still cannot get it to work.

0reactions
PhilTerzcommented, Oct 15, 2020

I see, I’ll go through that document again to try to reinstall.

In the Prettier Apex readme it says we can install globally or locally so I was following that.

Thanks for the help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SFDX in Visual Studio Code has no formatter for Apex files?
Doing so on an apex file returns the error: There is no formatter for 'apex'-files installed. Anyone know a solution to this? I'm...
Read more >
VS Code Extension: Prettier Code Formatter - SFDC Notes
To Run Prettier to format code, open any Apex file, then press Ctrl + Shift + P; Search for the word “Format”; Choose...
Read more >
Enable code formatting for apex in vs code - Forcetrails
Steps to Enable Apex code formatting in Visual Studio Code · 1. First, install the Prettier - code formatter. · 2. Now, check...
Read more >
There is no formatter for 'apex-anon' files installed. · Issue #155
There is no formatter for 'apex-anon' files installed. #155. Closed.
Read more >
How to setup prettier for apex in VSCode? - SFDC Stop
Please note that this will install prettier-plugin-apex locally in your project. ... You'll see that the apex files are also formatted.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found