void () { // highlight func declaration first, lest we get an "Extra fragment highlighted" error. EditorColorsScheme scheme = createTemporaryColorScheme(); TextAttributesKey xKey = TextAttributesKey.find("PY.FUNC_DEFINITION"); TextAttributes xAttributes = new TextAttributes(Color.red, Color.black, Color.white, EffectType.BOXED, Font.BOLD); scheme.setAttributes(xKey, xAttributes); doTest(); }