fix php editing (WI-1134)
authorEugene Kudelevsky <Eugene.Kudelevsky@jetbrains.com>
Fri, 19 Feb 2010 13:44:56 +0000 (16:44 +0300)
committerEugene Kudelevsky <Eugene.Kudelevsky@jetbrains.com>
Fri, 19 Feb 2010 13:44:56 +0000 (16:44 +0300)
xml/impl/src/com/intellij/codeInsight/template/XmlCustomLiveTemplate.java

index 8e6a65acd97d0633cc2bc06b4b3a434c9327d4c8..fad2be78c8bf4e31c789d2d620f46687c09cc43d 100644 (file)
 package com.intellij.codeInsight.template;
 
 import com.intellij.codeInsight.template.impl.TemplateImpl;
+import com.intellij.lang.xml.XMLLanguage;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.editor.Document;
 import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.editor.ScrollType;
 import com.intellij.openapi.util.Pair;
-import com.intellij.psi.xml.XmlFile;
+import com.intellij.psi.PsiFile;
 import com.intellij.util.containers.HashMap;
 import com.intellij.util.containers.HashSet;
 import org.jetbrains.annotations.NotNull;
@@ -273,7 +274,8 @@ public class XmlCustomLiveTemplate implements CustomLiveTemplate {
   }
 
   public boolean isApplicable(@NotNull String key, @NotNull CustomTemplateCallback callback) {
-    if (callback.getFile() instanceof XmlFile) {
+    PsiFile file = callback.getFile();
+    if (file.getLanguage() instanceof XMLLanguage) {
       List<MyToken> tokens = parse(key, callback);
       if (tokens != null) {
         return check(tokens);