UsageGroup (@NotNull Usage usage, UsageTarget @NotNull [] targets) { if (usage instanceof UsageInFile usageInFile) { VirtualFile file = usageInFile.getFile(); if (file != null) { if (file instanceof VirtualFileWindow) { file = ((VirtualFileWindow)file).getDelegate(); } VirtualFile dir = file.getParent(); if (dir == null) return null; return getGroupForFile(dir); } } return null; }