IC2 Prettier suppresses ApexDoc Comments Generation/Formatting

3 views
Skip to first unread message

Andrew

unread,
Nov 12, 2025, 5:57:46 PMNov 12
to Illuminated Cloud General Discussion
Dear Scott,

Thanks for your hard work maintaining and improving the IC!

Recently I discovered an issue with ApexDoc comments generation/formatting after installing Prettier plugin on IntelliJ IDEA (Ultimate). Though it is minor and seems like I can work around it I wanted to share it with you.

Configuration:
  • IntelliJ IDEA 2025.2.4 (Ultimate Edition)
  • IC2 v. 2.3.8.4
  • Prettier v. 3.6.2
  • MacOS Sequoia 15.6.1
  • IntelliJ > Settings > Editor > Code Style > Apex > ApexDoc:
    • Enable ApexDoc Formatting - Checked
    • Generate ApexDoc on /** - Checked
Use case #1
IntelliJ > Settings > Languages & Frameworks > JavaScript > Prettier > Run on "Reformat Code" action - Checked

Results
  • No ApexDoc generated on /** - empty comment block is generated

Use case #2
IntelliJ > Settings > Languages & Frameworks > JavaScript > Prettier > Run on "Reformat Code" action - Unchecked

Results: 
  • ApexDoc generated on /**
  • Reformat code (Option+Command+L) - fixes ApexDoc comment if applicable, same as "Clean up ApexDoc comment" context action
  • Reformat code with Prettier - does NOT fix ApexDoc comment, only formats the code
Technically the workaround may be:
  • IntelliJ > Settings > Languages & Frameworks > JavaScript > Prettier > Run on "Reformat Code" action - Unchecked
  • Use Reformat code (Option+Command+L) - to fix ApexDoc comments or use "Clean up ApexDoc comment" context action
  • Reformat code with Prettier (default or custom shortcut)
Wonder if I am missing some specific configuration to make ApexDoc comments and Prettier work together if prettier is triggered on default "Reformat Code" action. If so, please let me know.

Attached few screenshots for the visual context.

Thanks!

Regards,
Andrew

Screenshot 2025-11-12 at 23.04.03.png
Screenshot 2025-11-12 at 23.07.26.png
Screenshot 2025-11-12 at 23.08.18.png
Screenshot 2025-11-12 at 23.09.37.png



Scott Wells

unread,
Nov 12, 2025, 8:03:46 PMNov 12
to Illuminated Cloud General Discussion, Andrew

Andrew, thanks for raising this. I’m a bit confused, though. Do you have Prettier set up for *.cls, *.trigger, etc., as well? If not, I’m not sure why it would be kicking in for files of those types, and if so, I would expect Prettier to be the only formatter for those files, supeseding IC’s internal Apex formatter. That would likely result in the behavior your decribing since the ApexDoc formatter is invoked as part of the overarching Apex formatter.

Note that it’s getting into my evening so I may not have further responses until tomorrow morning, but feel free to send over any additional thoughts and/or answers to the questions above.

Regards,
Scott Wells

Patrick Visniewski

unread,
Nov 13, 2025, 7:27:10 PMNov 13
to Illuminated Cloud General Discussion, Scott Wells, Andrew
From the looks of the prettier config screenshot Andrew has it setup to work on .cls files along with .js and .trigger and some other type script files

Though Prettier is not actually an IC2 feature.

What it looks like to me, is that Prettier is actually messing up the ApexDoc formatting. Not sure if it knows how to deal with that or not since I don't use it (though I need to figure it out so require VS Code users to use it)

Your first use case seems like it has Prettier overriding or running after the IC2 formatting. 
Your second use case seems like it is letting the IC2 formatter do its job and is just not running Prettier since you did tell it to not run on reformat.
So really I'm not sure what the issue is other than I guess in the stack of formatting operations I guess Prettier is running after IC2.

So it doesn't seem like this is an IC2 issue at all. Just a Prettier issue.

It would help if you specified the steps you took after the config changes in each use case. Did you just do the config changes and then hit ONLY (Option+Command+L)  in both use cases or are you doing something else to also trigger prettier somehow?

Honestly I would recommend the IC2 formatter over prettier unless you have some reason to really want to use prettier.

Scott Wells

unread,
Nov 13, 2025, 7:56:01 PMNov 13
to Illuminated Cloud General Discussion, Patrick Visniewski, Scott Wells, Andrew
Ah, I hadn't seen that the Prettier config was in that set of images. Sorry. Yeah, basically you are either using IC as the Apex formatter or you're using Prettier. It's possible that there's some "in between" state because of how IC implements its ApexDoc formatting feature outside of the primary Apex formatter where that feature kicks in with Prettier, but that's not going to be a supported configuration. If you want to use Prettier to format Apex, you should disable ApexDoc formatting which I believe it pretty much the stated workaround.

Regards,
Scott Wells
Reply all
Reply to author
Forward
0 new messages