private final Module myModule;
public FileScope(PsiFile psiFile) {
myVirtualFile = psiFile.getVirtualFile();
Project project = psiFile.getProject();
ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
myModule = myVirtualFile != null ? fileIndex.getModuleForFile(myVirtualFile) : null;
}