Inline to anonymous class works only for java classes
[idea/community.git] / java / java-impl / src / com / intellij / refactoring / inline / InlineToAnonymousClassHandler.java
index 0462e6fbab1770f3a7fd6c9fe258e6aa3fa5a180..8a2e4b0c27829289eb6d50c7a22997e95035a969 100644 (file)
@@ -16,6 +16,7 @@
 package com.intellij.refactoring.inline;
 
 import com.intellij.codeInsight.TargetElementUtilBase;
+import com.intellij.lang.StdLanguages;
 import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.Ref;
@@ -41,6 +42,7 @@ public class InlineToAnonymousClassHandler extends JavaInlineActionHandler {
   }
 
   public boolean canInlineElement(PsiElement element) {
+    if (element.getLanguage() != StdLanguages.JAVA) return false;
     if (element instanceof PsiMethod) {
       PsiMethod method = (PsiMethod)element;
       if (method.isConstructor() && !InlineMethodHandler.isChainingConstructor(method)) {