PsiUtilsCore.findLanguageFromElement: result for empty and non-empty files should be the same +review CR-IC

This commit is contained in:
Dmitry Semeniouta
2013-12-04 20:52:03 +04:00
parent 84d8e52d93
commit a888bb5935
@@ -486,7 +486,7 @@ public class PsiUtilCore {
@NotNull
public static Language findLanguageFromElement(final PsiElement elt) {
if (elt.getFirstChild() == null) { //is leaf
if (!(elt instanceof PsiFile) && elt.getFirstChild() == null) { //is leaf
final PsiElement parent = elt.getParent();
if (parent != null) {
return parent.getLanguage();