This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 122190 - renaming does not allow file extension changes
Summary: renaming does not allow file extension changes
Status: NEW
Alias: None
Product: ide
Classification: Unclassified
Component: UI (show other bugs)
Version: 8.0.2
Hardware: All All
: P3 blocker with 18 votes (vote)
Assignee: issues@ide
URL:
Keywords:
: 123759 237555 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-11-16 23:37 UTC by ivar
Modified: 2016-10-03 02:06 UTC (History)
5 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ivar 2007-11-16 23:37:36 UTC
When renaming a file, netbeans prohibits the user from changing the file extension. 
The use case where this issue comes to light is when a user wishes to refactor a .rhtml file to be a .rxml file.
When renaming the 'name' of the file (sans extension) should be selected so typing overwrites the selected part, but
still leaves users the option of renaming the file completely.
Comment 1 Petr Nejedly 2007-11-19 13:27:13 UTC
Not a problem of the explorer. Explorer just uses Node's getName/setName methods.
Not a problems of the Node layer either, DataObject handles this.
Not even a problem of the DataSystems layer, each data object is free to implement getName/setName to allow file
extension change, as you can see on the example of text files: create a text file aa.txt, rename it however you wish.
You can even rename it to, say, aa.mf, but then the ManifestDataObject takes ownership of the file and no further
extension changes are possible.

If it's a use case for Ruby developers, then ruby's DataObject should allow this for it's files.
Comment 2 Petr Jiricka 2008-03-31 00:19:20 UTC
This is really an enhancement request, not a defect.
Comment 3 Petr Jiricka 2008-03-31 00:49:38 UTC
*** Issue 123759 has been marked as a duplicate of this issue. ***
Comment 4 voidmain 2008-12-31 14:42:31 UTC
This occurs across the entire IDE and not just in Ruby. C++ and other languages have the same issue. I don't know what
is the best category for things that span the entire IDE, but someone should reassign this.

Also, there are 10 other issues that are duplicates of this and one that looks like it was opened years ago. If you
search for "file extension" you'll see them all and someone should clean them up and then determine who needs to fix
this issue.
Comment 5 ducngtuan 2011-04-10 20:46:04 UTC
I'm currently using NetBeans 7 RC 2 on Mac OS and this problem still exists! I wonder if it would take that long to fix something like this.
Comment 6 purefan 2011-08-29 07:19:37 UTC
4 years and counting...
I know that going to Properties one can change the extension of the file, but what we want is to press F2 and be able to rename the extension as well, not having to right click + click on properties click on the "..." button before we can change the extension, and then pressing Enter doesnt equals to clicking "Ok" (looks like extensions can have line breaks in Netbeans' world).

Ideal Scenario:
(1)Left click file
(2)Press F2
(3)Rename file/extension
(4)Press enter

Current Scenario:
(1)Right click file
(2)Left click properties
(3)Left click "..." button
(4)Rename extension
(5)Left click Ok

Doesnt look like much and it probably isnt, but I still think its a better way
Comment 7 Marian Mirilovic 2013-08-01 03:53:43 UTC

*** This bug has been marked as a duplicate of bug 27444 ***
Comment 8 Michel Graciano 2013-08-01 14:20:36 UTC
Milo,
I don't think it is exactly a dup. It can be considered a ENH to make the UI better. Can I reopen it?
Comment 9 PowerKiKi 2013-09-30 06:13:37 UTC
I don't think it's fair to close this ticket as a duplicate of an 11 years old ticket (4 major version earlier).

I bumped the IDE version, since the problem still exists in NetBeans 7.3 and 7.4 beta when renaming from ".php" or ".phtml" for instance.
Comment 10 eggbert74 2013-10-24 19:35:29 UTC
Would like to add my vote to this.  I don't understand why netbeans ignores the extension while renaming a file, or while creating it.

A file extension is also part of the actual name of the file, especially for those with a unix mindset where it seems bizarre to hide file extensions.


Also creating "New" files of certain types is inconsistent.  If I create a new php file and enter "foo.php" I end up with foo.php.  However, if I create a new javascript file and enter "foo.js"  I end up with foo.js.js

It seems like all of that confusion could be avoided if netbeans considered the file extension as part of the file name.
Comment 11 cinderblock 2013-10-26 23:08:13 UTC
*** Bug 237555 has been marked as a duplicate of this bug. ***
Comment 12 Eccenux 2014-04-01 19:39:42 UTC
This still exists and I see no way to rename e.g. "index.html" file to "index.php" (extension change is not available even in Properties).
Comment 13 daiscog 2016-05-19 11:26:27 UTC
I've just voted for this, too.  I quite often find myself using the inbuilt file creation wizard to create a .jspf file but forgetting to click the "create as fragment" checkbox, so it gets created as a .jsp file instead.

Ideally, I'd like to just select the file, hit F2, and change the extension.  Why is on Earth should the IDE want to prevent me doing that?  Having to delete and recreate the file, or rename via the properties box is a frustrating PITA.
Comment 14 scientific 2016-08-17 11:27:04 UTC
I voted for this extremely useful feature because it make life easier. However, since years nobody is going to implement this. Amazing. I thought it is an easy task but I would guess its not.
Comment 15 almircampos 2016-10-03 02:06:29 UTC
I vote for this, too. Extremely useful. Doesn't make sense don't have it.