mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-19927 Add highlighting to __setstate__ and __sizeof__ magic methods
This commit is contained in:
@@ -388,6 +388,8 @@ public class PyNames {
|
||||
.put("__setattr__", new BuiltinDescription("(self, key, value)"))
|
||||
.put("__setitem__", new BuiltinDescription("(self, key, value)"))
|
||||
.put("__setslice__", new BuiltinDescription("(self, i, j, sequence)"))
|
||||
.put("__setstate__", new BuiltinDescription("(self, state)"))
|
||||
.put(SIZEOF, _only_self_descr)
|
||||
//_BuiltinMethods.put("__self__", _only_self_descr);
|
||||
//_BuiltinMethods.put("__slots__", _only_self_descr);
|
||||
.put("__str__", _only_self_descr)
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
class <info descr="null" type="INFORMATION">A</info>():
|
||||
def <info descr="null" type="INFORMATION" foreground="0x00ff00" background="0x000000" effectcolor="0xffffff" effecttype="BOXED" fonttype="1">__sizeof__</info>(<info descr="null">self</info>):
|
||||
pass
|
||||
|
||||
def <info descr="null" type="INFORMATION" foreground="0x00ff00" background="0x000000" effectcolor="0xffffff" effecttype="BOXED" fonttype="1">__setstate__</info>(<info descr="null">self</info>, <info descr="null">state</info>):
|
||||
pass
|
||||
@@ -266,6 +266,20 @@ public class PythonHighlightingTest extends PyTestCase {
|
||||
doTest(LanguageLevel.PYTHON35, false, false);
|
||||
}
|
||||
|
||||
// PY-19927
|
||||
public void testMagicMethods() {
|
||||
EditorColorsManager manager = EditorColorsManager.getInstance();
|
||||
EditorColorsScheme scheme = (EditorColorsScheme)manager.getGlobalScheme().clone();
|
||||
manager.addColorsScheme(scheme);
|
||||
EditorColorsManager.getInstance().setGlobalScheme(scheme);
|
||||
|
||||
TextAttributesKey xKey = TextAttributesKey.find("PY.PREDEFINED_DEFINITION");
|
||||
TextAttributes xAttributes = new TextAttributes(Color.green, Color.black, Color.white, EffectType.BOXED, Font.BOLD);
|
||||
scheme.setAttributes(xKey, xAttributes);
|
||||
|
||||
doTest();
|
||||
}
|
||||
|
||||
// PY-19775
|
||||
public void testAsyncBuiltinMethods() {
|
||||
doTest(LanguageLevel.PYTHON35, true, false);
|
||||
|
||||
Reference in New Issue
Block a user