diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomManagerImpl.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomManagerImpl.java index 4c46c38775bb..10b8cc700921 100644 --- a/xml/dom-impl/src/com/intellij/util/xml/impl/DomManagerImpl.java +++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomManagerImpl.java @@ -1,5 +1,6 @@ package com.intellij.util.xml.impl; +import com.intellij.ide.highlighter.DomSupportEnabled; import com.intellij.ide.startup.StartupManagerEx; import com.intellij.openapi.Disposable; import com.intellij.openapi.components.ServiceManager; @@ -337,7 +338,7 @@ public final class DomManagerImpl extends DomManager { @Nullable public final DomFileElementImpl getFileElement(XmlFile file) { if (file == null) return null; - if (!StdFileTypes.XML.equals(file.getFileType())) return null; + if (file.getFileType() instanceof DomSupportEnabled) return null; final VirtualFile virtualFile = file.getVirtualFile(); if (virtualFile != null && virtualFile.isDirectory()) return null; return this.getOrCreateCachedValueProvider(file).getFileElement(); diff --git a/xml/impl/src/com/intellij/ide/highlighter/DomSupportEnabled.java b/xml/impl/src/com/intellij/ide/highlighter/DomSupportEnabled.java new file mode 100644 index 000000000000..ff27af059112 --- /dev/null +++ b/xml/impl/src/com/intellij/ide/highlighter/DomSupportEnabled.java @@ -0,0 +1,26 @@ +/* + * Copyright 2000-2011 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.ide.highlighter; + +/** + * Created by IntelliJ IDEA. + * User: zajac + * Date: 15.04.11 + * Time: 14:57 + * To change this template use File | Settings | File Templates. + */ +public interface DomSupportEnabled { +} diff --git a/xml/impl/src/com/intellij/ide/highlighter/XmlFileType.java b/xml/impl/src/com/intellij/ide/highlighter/XmlFileType.java index 5b90121be6ef..1a720d69eb9d 100644 --- a/xml/impl/src/com/intellij/ide/highlighter/XmlFileType.java +++ b/xml/impl/src/com/intellij/ide/highlighter/XmlFileType.java @@ -24,7 +24,7 @@ import org.jetbrains.annotations.NotNull; import javax.swing.*; -public class XmlFileType extends XmlLikeFileType { +public class XmlFileType extends XmlLikeFileType implements DomSupportEnabled { public static final XmlFileType INSTANCE = new XmlFileType(); @NonNls public static final String DEFAULT_EXTENSION = "xml"; @NonNls public static final String DOT_DEFAULT_EXTENSION = "."+DEFAULT_EXTENSION;