Type (@Nullable SearchScope scope) { if (scope instanceof ProjectScopeImpl || scope == null) { return Type.PROJECT; } else if (scope instanceof ModuleWithDependenciesScope) { return Type.MODULE; } else if (scope instanceof GlobalSearchScopesCore.DirectoryScope) { return Type.DIRECTORY; } else { return Type.NAMED; } }