boolean (@NotNull PsiElement element) { PsiFile psiFile = element.getContainingFile(); if (psiFile == null) return false; VirtualFile virtualFile = psiFile.getVirtualFile(); if (virtualFile == null) return false; return GradleConstants.EXTENSION.equals(virtualFile.getExtension()); }