Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wrong file association for one file in IntelliJ / Android Studio

I accidentally created a file without a .xml extension. I clicked through another dialog immediately after associating that file as some other type...? After renaming the file to include .xml the file still has no syntax highlighting. I've tried closing Android Studio, deleting the file and recreating, etc. It still shows up as a regular file. If I create a file with a different .xml file, it associates fine.

Any ideas?

like image 339
loeschg Avatar asked Jan 24 '14 15:01

loeschg


3 Answers

Look in the Preferences > Editor > File Types under Text files, the name of your file is probably there, remove it.

Preferences > Editor > File Types


If you cannot find it there, the next option is to search IntelliJ's caches for the name of the file, e.g., find . -name "*.xml" | xargs grep "Whoopsies". IntelliJ has to be remembering that value somehow...


The cache locations depends on your operating system and IntelliJ version (source).

Windows

Windows Vista, 7, 8:

\Users\[USER ACCOUNT NAME]\.[PRODUCT][VERSION]

Windows XP:

[SYSTEM DRIVE]\Documents and Settings\[USER ACCOUNT NAME]\.[PRODUCT][VERSION]

*nix

~/.[PRODUCT][VERSION]

Mac OS X

Configuration:

~/Library/Preferences/[PRODUCT][VERSION]

Caches:

~/Library/Caches/[PRODUCT][VERSION]

Plugins:

~/Library/Application Support/[PRODUCT][VERSION]

Logs:

~/Library/Logs/[PRODUCT][VERSION]
like image 91
kuporific Avatar answered Oct 31 '22 05:10

kuporific


I got the same sort of problem. I found my file in the following File Type:

enter image description here

like image 23
Michel Avatar answered Oct 31 '22 06:10

Michel


I had the same issue where I accidentally had a file be auto-detected as text in IntelliJ Idea.

Unfortunately whenever I would go to the File Types dialog like other answers suggest I could never find it there.

So I went to my IntelliJ configuration folder (see here for where to find it) which for me was in ~/AppData/Roaming/JetBrains/IntelliJIdea2021.1/options and found the fileTypes.xml file.

In there I found the line which contained the association for my specific filename and deleted it and saved the file.

Then I closed IntelliJ and reopened it and it worked.

like image 32
vab2048 Avatar answered Oct 31 '22 04:10

vab2048