mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PsiUtilsCore.findLanguageFromElement: result for empty and non-empty files should be the same +review CR-IC
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user