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

Key: IDEADEV-23692
Type: Task Task
Status: Open Open
Priority: Normal Normal
Assignee: Alexey Kudravtsev
Reporter: Eugene Zhuravlev
Votes: 0
Watchers: 4
Operations

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

"Optimize imports on the fly" and "add imports on the fly" options should be stored in iws file

Created: 04 Dec 07 20:33   Updated: 06 Nov 08 23:06
Component/s: Project Configuration
Fix Version/s: Undefined

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Severity: High


 Description  « Hide
Ideally options that regulate IDE behaviour should not be associated with project. Even if there is a need for that for some users, storing them in IWS file (with ability to edit project template) will provide a good compromise.

 All   Comments   Work Log   Change History      Sort Order:
Stephen Friedrich - 04 Dec 07 21:45
Err, didn't it work that way in Demetra and was intentionally changed to the current behavior?

Anyway, I like it the way it works in Selena:
Some of my projects are shared among other developers, some of them using Eclipse: On these projects imports must not be changed, because they do not always follow a common pattern. Changing them would bring noise to CVS.

On my own projects I have both options enabled, so that imports always stay clean.


Eugene Zhuravlev - 05 Dec 07 15:59
What about thouse people who always keep this option off and optimize imports on checkin?

Eugene Zhuravlev - 05 Dec 07 16:01
These options, although associated with projects, obviously must not be shared because they reflect preferences of particular user. It's just like colors in the editor.

Stephen Friedrich - 05 Dec 07 22:23
No, it's completely different from the color settings:
It logically belongs to the code style. If you share the project you want to have a common style for imports.
(If you do not share the project then the discussion is moot anyway, right?)

Having said that, I have to correct myself a little:
"Optimize imports on the fly" belongs to the project setting, because it changes the shared code base.
"Add Imports on the fly" really could be an IDE level setting: The code will look the same any way if the import is added on the fly or if the import is added by invoking the import quickfix. (Or entering the import statement manually - but I doubt that anybody in 2007 does that.)


Sascha Weinreuter - 05 Dec 07 22:28
Hmm, I'd say it should either be an IDE setting or a project setting because I think it would drive me nuts when having to configure these options for every project I check out on a different machine. My personal preference would be the IDE setting - like it used to be in 6.0.x.

Stephen Friedrich - 05 Dec 07 22:36
Sascha, do you work on different projects where the imports of one project must not be touched (re-organized) and the other project requires to always optimize imports according to Idea's code style?

In Demetra I had to switch the IDE setting each time I opened another project.
(Which naturally happens much more often than checking out. a project.)


Sascha Weinreuter - 05 Dec 07 22:58
No, to be honest, this affects only projects where the imports don't matter to anyone.

I see the problem, but to be honest the level of complexity and the potential to get unexpected/unwanted behavior at a different workstation or a new project has already been increased with the change from IDEA 6 to 7 (I've wondered about the missing auto-import several times now). Now storing the settings for the project-specific code style in the IWS would finally end in something that will almost never work out-of-the-box without tweaking anything first.


Eugene Zhuravlev - 05 Dec 07 23:16
Sascha, I agree with your last statement and I myself would prefer to see the option in the IDE settings (like it was previously), but there's a number of users that find the project level setup useful, so the iws file is a good compromise.

And Stephen, I can suggest a "fix" for your problem: just turn off those settings and use "Optimize imports before checkin".