Hello,
I accidentally added an entry to the TEXT default file type association via the unknown file type popup (can't remember what the actual title of the popup was, so will refer to it as this from now on). Now I cannot create a java source file because intellij thinks it is a TEXT file type. To be honest, I can't remember the exact steps I took to get into this situation, but i'll summerize as best as I can.
Instead of going to the normal way of creating a java class file (right-click->New->Java Class), I accidentally used the new file option in the dropdown (right-click->New->File). I gave it my file name but forgot the file extension. For example, I will use "SomeFileName" as the file name. Once I clicked ok, it gave me a popup to select the file type I wanted to associate with it. I selected Java Source File (.java) and hit ok. But found that for some reason or another it wasn't recognising it as a java source file. So I tried renaming it to a regular file with no extension again. I also tried deleting the file and recreating it as a java source file (right-click->New->Java Class). Unfortunately, at this point I got the following error message in a popup "Unable to parse template "Class"
Error message: Selected class file name 'SomeFileName.java' mapped to not java file type 'Text files'". From there I check the File Type associations via IntelliJ Idea->Preferences->IDE Settings->File Types, and sure enough, if I click on the "Text files" under the recognized file types section and scroll to the bottom, I see "SomeFileName.java" in the list of patterns. Strangely, if I click on the "Java Source files" under the recognized file types section, I also see "SomeFileName" in the list of patterns.
Unfortunately, It looks like I am unable to remove these patterns as both "Java Source files" and "Text files" have the Edit button disabled since they are default file types. So my question is, do I have to completely reinstall intellij idea to remove these entries, or is there some config file in the install I can manually remove these patterns from?
I have tried deleting my .idea directory completely, closing the project, and then recreateing the project from the pom file, but this doesn't seem to affect the file type associations. I have also tried deleting the .iml file in the project, which also seemed to do nothing (though why there is a .iml file in the first place i'm not sure, since the project is a .idea folder based project). This makes sense since the file type associations are a global ide setting, not a project specific one. My idea install is on MacOSX 10.7.4, idea version 11.1.5 (build 117.1037), running on java 1.6.0_37 64-bit.
Also, I am wondering if this should be filed as a bug, since I would think if you were able to add an entry into these default file types, you should be able to remove that same entry. I understand not being able to remove or edit the actual default patterns in the default file type, but I think you should be able to remove any pattern you add via the unknown file type popup.