GlobalSearchScope (@NotNull Project project, @NotNull NamedScope namedScope, boolean colored) { GlobalSearchScope scope = GlobalSearchScopesCore.filterScope(project, namedScope); if (!colored && !(namedScope instanceof WeighedItem)) return scope; int weight = namedScope instanceof WeighedItem ? ((WeighedItem)namedScope).getWeight() : -1; Color color = !colored ? null : //namedScope instanceof ColoredItem ? ((ColoredItem)namedScope).getColor() : FileColorManager.getInstance(project).getScopeColor(namedScope.getScopeId()); return new MyWeightedScope(scope, weight, color); }