ignore unnecessary semicolon inspection in template files (IDEA-136936)
authorpeter <peter@jetbrains.com>
Wed, 25 Feb 2015 16:46:31 +0000 (17:46 +0100)
committerpeter <peter@jetbrains.com>
Wed, 25 Feb 2015 16:48:22 +0000 (17:48 +0100)
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/UnnecessarySemicolonInspection.java

index 36f5af9408df8fa1d33ae4efe9db73473c8abdc2..2f3880a4dd66431fa748236521012ada7bbc2b31 100644 (file)
@@ -18,6 +18,7 @@ package com.siyeh.ig.style;
 import com.intellij.codeInspection.CleanupLocalInspectionTool;
 import com.intellij.codeInspection.ProblemDescriptor;
 import com.intellij.codeInspection.ProblemHighlightType;
 import com.intellij.codeInspection.CleanupLocalInspectionTool;
 import com.intellij.codeInspection.ProblemDescriptor;
 import com.intellij.codeInspection.ProblemHighlightType;
+import com.intellij.lang.LanguageUtil;
 import com.intellij.openapi.project.Project;
 import com.intellij.psi.*;
 import com.intellij.psi.tree.IElementType;
 import com.intellij.openapi.project.Project;
 import com.intellij.psi.*;
 import com.intellij.psi.tree.IElementType;
@@ -110,6 +111,8 @@ public class UnnecessarySemicolonInspection extends BaseInspection implements Cl
     }
 
     private void findTopLevelSemicolons(PsiElement element) {
     }
 
     private void findTopLevelSemicolons(PsiElement element) {
+      if (LanguageUtil.isInTemplateLanguageFile(element)) return;
+      
       for (PsiElement sibling = element.getFirstChild(); sibling != null; sibling = skipForwardWhiteSpacesAndComments(sibling)) {
         if (PsiUtil.isJavaToken(sibling, JavaTokenType.SEMICOLON)) {
           registerError(sibling, ProblemHighlightType.LIKE_UNUSED_SYMBOL);
       for (PsiElement sibling = element.getFirstChild(); sibling != null; sibling = skipForwardWhiteSpacesAndComments(sibling)) {
         if (PsiUtil.isJavaToken(sibling, JavaTokenType.SEMICOLON)) {
           registerError(sibling, ProblemHighlightType.LIKE_UNUSED_SYMBOL);