History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEABKL-3347
Type: New Feature New Feature
Status: Open Open
Priority: Normal Normal
Assignee: Olesya Smirnova
Reporter: Jesper Vrelits
Votes: 11
Watchers: 4
Available Workflow Actions

Mark as Stalled
Operations

If you were logged in you would be able to see more operations.
IDEA: Backlog

Ability to switch off formatting on commit on a per language basis

Created: 15 Jul 05 16:48   Updated: 12 Feb 08 17:33
Component/s: Code Formatting and Code Style, Version Control Integration
Affects Version/s: None
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Issue Links:
Duplicate
 
This issue is duplicated by:
IDEA-5077 Commit Project: Want to reformat code... Resolved

Build: 3,401
Severity: High


 Description  « Hide
I haven't quite gotten used to the new JSP/HTML reformat feature.

I have always used java reformat, though, in the default setup.

I would like to be able to disable JSP/HTML reformat
at least in the Project Commit window where I usually have
'reformat' checked. I don't do that anymore because I don't like
the JSP/HTML reformatting.

Yes, I know, I could work on defining the reformatting too
my liking (if possible)..



 All   Comments   Work Log   Change History      Sort Order:
Tom W - 12 Feb 08 17:33
This feature would relieve much pain in my commit process.

Details from a forum thread I started:
http://intellij.net/forums/thread.jspa?messageID=5207000
<snip>
I'm working in an a team with mostly Eclipse users, and I recently switched to Intellij on the project. All's well for the most part, I love the many easy to use productivity features, but I find dealing with Code reformatting more painful than I would like.

I'd like to easily (i.e. without thinking about it) only format Java code when I commit (or when I save for that matter). I don't want to format any other file types (xml, html, etc) other than Java code, because we can't get Eclipse and Intellij to play nice when it comes to reformatting non-Java files exactly the same way. Reformatting files the same no matter who checks in is critical for file difference checking for code review and viewing history. So we have elected to not auto-reformat non-Java files, but rather just format the areas we are working on with informal standards.

In Eclipse, one can achieve this with the "Save Action" concept, which in their case, can allow you to reformat just Java files on Save. I don't see the equivalent feature in IDEA.

The closest thing I have found so far in IDEA is the ability to reformat during a check-in, but that doesn't appear to allow one to selectively say which types are reformatted. I haven't found any "auto-reformat on save" options either.

So, now my workaround commit process is:
In the changes view, select only the Java files, then enable the "organize imports" and "reformat code" check then hit commit. Then I select the rest of the files (the non-java files) , deselect "organize imports" (which would alter jsp files), and "reformat code" and then commit those files. Non-only is this a multi step process where there could just be one, but it's easy to accidentally commit with the settings on or off and then suddenly be the bad code citizen who reformatted some non-java code, or didn't format some Java code.

Perhaps if I could completely disable all other types of code formatting other than Java, I could commit, but then I would lose the ability to code format "selected text" of jsp's etc to manually format just code that I am changing.
</snip>