GradleVersion (Project project, PsiFile file) { VirtualFile virtualFile = file.getVirtualFile(); if (virtualFile != null) { String filePath = virtualFile.getPath(); return getGradleVersion(project, filePath); } return GradleVersion.current(); }