void () { NamedScope xScope = new NamedScope("xxx", new PatternPackageSet("x..*", PatternPackageSet.Scope.ANY, null)); NamedScope utilScope = new NamedScope("util", new PatternPackageSet("java.util.*", PatternPackageSet.Scope.LIBRARY, null)); NamedScopesHolder scopeManager = DependencyValidationManager.getInstance(getProject()); scopeManager.addScope(xScope); scopeManager.addScope(utilScope); EditorColorsScheme scheme = cloneColorSchema(); TextAttributesKey xKey = ScopeAttributesUtil.getScopeTextAttributeKey(xScope.getScopeId()); TextAttributes xAttributes = new TextAttributes(Color.cyan, Color.darkGray, Color.blue, null, Font.ITALIC); scheme.setAttributes(xKey, xAttributes); TextAttributesKey utilKey = ScopeAttributesUtil.getScopeTextAttributeKey(utilScope.getScopeId()); TextAttributes utilAttributes = new TextAttributes(Color.gray, Color.magenta, Color.orange, EffectType.STRIKEOUT, Font.BOLD); scheme.setAttributes(utilKey, utilAttributes); NamedScope projectScope = PackagesScopesProvider.getInstance(myProject).getProjectProductionScope(); TextAttributesKey projectKey = ScopeAttributesUtil.getScopeTextAttributeKey(projectScope.getScopeId()); TextAttributes projectAttributes = new TextAttributes(null, null, Color.blue, EffectType.BOXED, Font.ITALIC); scheme.setAttributes(projectKey, projectAttributes); try { testFile(BASE_PATH + "/scopeBased/x/Shared.java").projectRoot(BASE_PATH + "/scopeBased").checkSymbolNames().test(); } finally { scopeManager.removeAllSets(); } }