How do I auto-indent an entire project?

已回答

I'm coming to a legacy Java project that was indented using tabs (*cringe*).  I would like to use IntelliJ to auto-indent all the Java files in the project.  However, I can't figure out how to do this for the entire project at once.  Is it possible?

1
Avatar
Permanently deleted user

Hi Jared,

It's not possible to do that at the moment. The only option is to perform complete reformat - right click on the target node at project view and call 'reformat code' from the context menu. That will recursively process all files below that node.

Denis

0

This is a very old thread, I know, but maybe someone could chime in from JB and tell us how to reformat code recursively within a folder. The technique described by Denis doesn't seem to be valid anymore - no such option in the right-click menu (Mac).

0
Avatar
Permanently deleted user

Old but someone might stumble on this.

Select the folder you want to reformat and click on the Code Menu in the Menu bar. There you will find the Reformat Code option.

2

请先登录再写评论。