Press Ctrl+Alt+S to open the IDE settings and select Editor | File Types. From the Recognized File Types list, select the file type that you want to associate with other filename patterns.
To toggle read-only attribute of a file, open file in the editor, or select it in the Project tool window. Do one of the following: On the main menu, choose File | File Properties | Make File Read-Only , or Make File Writable .
It means that the files exist locally, but are not in the repository, and are not scheduled for addition. With other words, the files are not under version control. There is not really a problem since the files can just be added to the VCS if desired.
Please ensure that this file (or a pattern that represents it) is not listed under
Settings → Editor → File Types→ Text
For OS X
Preferences → Editor → File Types→ Text
Sometimes the file or pattern are stuck under File type auto-detected by file content
instead of Text
.
Step 1: Click "File" ==> "Settings" for Windows or "InterlliJ IDEA" ==> "Preferences" for Mac
Step 2: Expand "Editor" & Click "File Types"
Step 3: You will see all file types on Right. Navigate to the "Text" entry and click 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
In 2020 none of the posted answers worked, here's what did:
OSX:
Preferences > Editor > File Types > Text
Windows:
Settings > Editor > File Types > Text Files
I had the same problem and none of the above solution solved it. The thing that at the end solved it was by selecting the module and going to the module settings(press F4 on the module name)
Then in the Sources tab, select the "java" folder and press on the Sources button. That tells IntelliJ that the folder in question is a source code folder.
Then select the Test folder and press Tests.
That's it. Then it will recognize correctly the files and show errors as needed.
See below the screenshot.
I solved the same issue by
Right-click on the file -> "Override File Type" -> Select the extension type the file has.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With