Copy+Paste Apex Code Reformatting

17 views
Skip to first unread message

John Lewis

unread,
Oct 2, 2023, 2:38:21 AM10/2/23
to Illuminated Cloud General Discussion
Hello,

when using Illuminated Cloud a a plugin in IntelliJ IDEA Community Edition (on Windows) is there a way I can configure it so that when I copy+paste Apex Code then it inserts the pasted code into the target file EXACTLY as it is in the source file, without doing any reformatting whatsover?

What I typically find is that when I copy some code such as:
        List<Account> acs = [select Id, Name
                                from Account
                                where Id in :acIds];
it is then pasted as:
        List<Account> acs = [select Id, Name
        from Account
        where Id in :acId
s];

i.e. the 2nd and 3rd lines of the SOQL query are shifted to the left.

Regards

John Lewis

Scott Wells

unread,
Oct 2, 2023, 9:37:52 AM10/2/23
to Illuminated Cloud General Discussion, John Lewis
Hi, John. Try changing this configuration option to Reformat block:

Auto_Reformat_On_Paste.png

Regards,
Scott Wells

John Lewis

unread,
Oct 2, 2023, 9:41:25 AM10/2/23
to Illuminated Cloud General Discussion, Scott Wells, John Lewis
Thanks! That worked perfectly.
Reply all
Reply to author
Forward
0 new messages