PsiElement () { final Project project = myFile.getProject(); final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex(); final VirtualFile formVirtualFile = myFile.getVirtualFile(); if (formVirtualFile == null) { return null; } final Module module = fileIndex.getModuleForFile(formVirtualFile); if (module == null) { return null; } PropertiesFile propertiesFile = PropertiesUtilBase.getPropertiesFile(getRangeText(), module, null); return propertiesFile == null ? null : propertiesFile.getContainingFile(); }