IntelliJ not recognizing a particular file correctly, instead its stuck as a text file
Please ensure that this file (or a pattern that represents it) is not listed under
Settings → Editor → File Types→ Text files
For OS X
Preferences → Editor → File Types→ Text files
Step 1: Click "File"==> "Settings"
Step 2: Expand "Editor" & Click "File Types"
Step 3: You will see all file types on Right. Navigate to the "Text" entry and lick it
Step 4: You should able to see your file name on the bottom of Registered Patterns (lower box)
Step 5: Remove your file from the Registered Patterns. The problem should be solved and let you rename with fileName.java
Step 6: If not, delete the file from the project and create it again with name fileName
Source
OSX:
Preferences > Editor > File Types > Text
Windows:
Settings > Editor > File Types > Text Files