avoid exception on trying to detect injection inside another injection (WI-9523)
authorMaxim.Mossienko <maxim.mossienko@jetbrains.com>
Mon, 30 Jan 2012 12:01:55 +0000 (16:01 +0400)
committerMaxim.Mossienko <maxim.mossienko@jetbrains.com>
Mon, 30 Jan 2012 12:04:31 +0000 (16:04 +0400)
platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedLanguageUtil.java

index 050f1efad0693c6a6cd73d7ce7dafac887307f66..7baf631f9661108d6a1d4f792ff52d27d5d6a986 100644 (file)
@@ -132,6 +132,8 @@ public class InjectedLanguageUtil {
       if (file == null || !file.isPhysical() && file.getOriginalFile() == file) return;
     }
 
       if (file == null || !file.isPhysical() && file.getOriginalFile() == file) return;
     }
 
+    if (containingFile.getViewProvider() instanceof InjectedFileViewProvider) return; // no injection inside injection
+
     PsiElement inTree = loadTree(host, containingFile);
     if (inTree != host) {
       host = inTree;
     PsiElement inTree = loadTree(host, containingFile);
     if (inTree != host) {
       host = inTree;