shdqcdsn / counterclockwise

Automatically exported from code.google.com/p/counterclockwise
0 stars 0 forks source link

Changing the namespace should rename the file. (Sea also issue 514) #638

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Related but opposite to issue 514

I find renaming files in eclipse really tedious. (Too many menus and popups for 
such a simple operation). So I would prefer that changing the namespace renamed 
the file. That seems more natural to me.

I see this happening on save only.

It should be optional/configurable.

Auto search and update of related namespaces (mentioned in issue 514) are 
secondary for me. 

Original issue reported on code.google.com by daves...@gmail.com on 17 May 2014 at 11:27

GoogleCodeExporter commented 9 years ago
Would you see this with a confirmation popup such as:
Title: "About to rename file"
Content: "File content declares namespace foo-bar while filename refers to 
namespace bar-foo. Do you want to change filename?"
Choice: Yes / No
(Optionally: a "[ ] Don't ask me again" checkbox)

Or just a global option "Automatically rename file on save when namespace name 
does not match" (checked by default) and no popup?

Please feel free to suggest improved versions of the above texts since I'm not 
native english speaker and I tend to not be concise enough in my choices.

Original comment by laurent....@gmail.com on 22 May 2014 at 7:01

GoogleCodeExporter commented 9 years ago
1.
Make it a globally configurable option
Rename files to match the declared namespace:
 [ ] always 
 [ ] never 
 [*] ask

Ask initially by default. Which will produce the popup. This will ensure that 
users know it is available and know what is happening but aren't taken by 
surprise.

Title  : Rename file to match namespace?
Content: The current filename does not match the declared namespace 'foo.bar'. 
Do you want to rename the file?
Choice : Yes / No 
Options:
 [] always rename 
 [] never rename

Or

2. Consider using the eclipse quick fix annotations that are/used-to be used to 
correct things like missing imports and minor errors.

(Thanks for looking into this and for your hard work on ccw. it is much 
appreciated.)

Original comment by daves...@gmail.com on 22 May 2014 at 9:52

GoogleCodeExporter commented 9 years ago
Would you prefer 1/ or 2/ ?

Original comment by laurent....@gmail.com on 22 May 2014 at 9:56

GoogleCodeExporter commented 9 years ago
I would be happy with either. I think 1 is better. I would have this on by 
default.

Original comment by daves...@gmail.com on 22 May 2014 at 10:21