IntelliJ / Android Studio中一个文件的错误关联

时间:2021-09-07 15:01:17

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.

我不小心创建了一个没有.xml扩展名的文件。在将该文件与其他类型关联之后,我点击了另一个对话框。将文件重命名为包含.xml后,该文件仍然没有突出显示语法。我尝试过关闭Android Studio、删除文件、重新创建文件等等。它仍然以常规文件的形式出现。如果我用不同的.xml文件创建一个文件,它会很好地关联。

Any ideas?

什么好主意吗?

2 个解决方案

#1


139  

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

在首选项>编辑器>文件类型下的文本文件,您的文件的名称可能在那里,删除它。

IntelliJ / Android Studio中一个文件的错误关联


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...

如果在那里找不到它,下一个选项是搜索IntelliJ的缓存来查找文件的名称,例如find。- name”*。xml" | xargs grep "Whoopsies"。IntelliJ必须以某种方式记住那个值……


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

缓存位置取决于您的操作系统和IntelliJ版本(源代码)。

Windows

Windows Vista, 7, 8:

Windows Vista 7 8:

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

Windows XP:

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]

#2


11  

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

我也有同样的问题。我发现我的文件类型如下:

IntelliJ / Android Studio中一个文件的错误关联

#1


139  

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

在首选项>编辑器>文件类型下的文本文件,您的文件的名称可能在那里,删除它。

IntelliJ / Android Studio中一个文件的错误关联


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...

如果在那里找不到它,下一个选项是搜索IntelliJ的缓存来查找文件的名称,例如find。- name”*。xml" | xargs grep "Whoopsies"。IntelliJ必须以某种方式记住那个值……


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

缓存位置取决于您的操作系统和IntelliJ版本(源代码)。

Windows

Windows Vista, 7, 8:

Windows Vista 7 8:

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

Windows XP:

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]

#2


11  

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

我也有同样的问题。我发现我的文件类型如下:

IntelliJ / Android Studio中一个文件的错误关联