boolean (Object element) { // may be called from unexpected thread if (element instanceof PsiFileSystemItem item) { element = item.getVirtualFile(); } return element instanceof VirtualFile && canRepresent((VirtualFile)element); }