mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
look for xml properties in files with xml file type only
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.lang.properties.xml;
|
||||
|
||||
import com.intellij.ide.highlighter.XmlFileType;
|
||||
import com.intellij.lang.properties.IProperty;
|
||||
import com.intellij.lang.properties.PropertiesUtil;
|
||||
import com.intellij.lang.properties.ResourceBundle;
|
||||
@@ -71,7 +72,7 @@ public class XmlPropertiesFile implements PropertiesFile {
|
||||
|
||||
@Nullable
|
||||
public static PropertiesFile getPropertiesFile(final PsiFile file) {
|
||||
return file instanceof XmlFile ? getPropertiesFile((XmlFile)file) : null;
|
||||
return file instanceof XmlFile && file.getFileType() == XmlFileType.INSTANCE ? getPropertiesFile((XmlFile)file) : null;
|
||||
}
|
||||
|
||||
public static PropertiesFile getPropertiesFile(final XmlFile file) {
|
||||
|
||||
+4
-1
@@ -1,6 +1,7 @@
|
||||
package com.intellij.lang.properties.xml;
|
||||
|
||||
import com.intellij.ide.IconProvider;
|
||||
import com.intellij.ide.highlighter.XmlFileType;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.xml.XmlFile;
|
||||
import icons.PropertiesIcons;
|
||||
@@ -16,6 +17,8 @@ public class XmlPropertiesIconProvider extends IconProvider {
|
||||
|
||||
@Override
|
||||
public Icon getIcon(@NotNull PsiElement element, int flags) {
|
||||
return element instanceof XmlFile && XmlPropertiesFile.getPropertiesFile((XmlFile)element) != null ? PropertiesIcons.XmlProperties : null;
|
||||
return element instanceof XmlFile &&
|
||||
((XmlFile)element).getFileType() == XmlFileType.INSTANCE &&
|
||||
XmlPropertiesFile.getPropertiesFile((XmlFile)element) != null ? PropertiesIcons.XmlProperties : null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user