@@ -22,7 +22,10 @@ class PythonVariableSimpleNode(private val variable: LiveVariable) : SimpleNode(
2222
2323 override fun getChildren (): Array <SimpleNode > {
2424 if (variable.liveClazz == " <class 'dict'>" ) {
25- val dict = JsonObject ((variable.value as String ).replace(" '" , " \" " ))
25+ val dict = JsonObject (
26+ (variable.value as String ).replace(" '" , " \" " )
27+ .replace(" : True" , " : true" ).replace(" : False" , " : false" )
28+ )
2629 val children = mutableListOf<SimpleNode >()
2730 dict.map.forEach {
2831 children.add(PythonVariableSimpleNode (LiveVariable (" '" + it.key + " '" , it.value)))
@@ -46,29 +49,29 @@ class PythonVariableSimpleNode(private val variable: LiveVariable) : SimpleNode(
4649 )
4750 }
4851
49- when (variable.liveClazz) {
50- " <class 'dict '>" -> {
52+ when {
53+ variable.liveClazz == " <class 'int '>" || variable.value is Number -> {
5154 presentation.addText(
5255 variable.value.toString(),
53- SimpleTextAttributes .fromTextAttributes(scheme.getAttributes(DefaultLanguageHighlighterColors .IDENTIFIER ))
56+ SimpleTextAttributes .fromTextAttributes(
57+ scheme.getAttributes(DefaultLanguageHighlighterColors .NUMBER )
58+ )
5459 )
5560 }
56- " <class 'str'>" -> {
61+ variable.liveClazz == " <class 'str'>" -> {
5762 presentation.addText(
5863 " \" " + variable.value + " \" " ,
59- SimpleTextAttributes .fromTextAttributes(scheme.getAttributes(DefaultLanguageHighlighterColors .STRING ))
60- )
61- }
62- " <class 'NoneType'>" -> {
63- presentation.addText(
64- variable.value.toString(),
65- SimpleTextAttributes .fromTextAttributes(scheme.getAttributes(DefaultLanguageHighlighterColors .IDENTIFIER ))
64+ SimpleTextAttributes .fromTextAttributes(
65+ scheme.getAttributes(DefaultLanguageHighlighterColors .STRING )
66+ )
6667 )
6768 }
6869 else -> {
6970 presentation.addText(
7071 variable.value.toString(),
71- SimpleTextAttributes .fromTextAttributes(scheme.getAttributes(DefaultLanguageHighlighterColors .CONSTANT ))
72+ SimpleTextAttributes .fromTextAttributes(
73+ scheme.getAttributes(DefaultLanguageHighlighterColors .IDENTIFIER )
74+ )
7275 )
7376 }
7477 }
0 commit comments