@@ -11,8 +11,9 @@ import java.util.*
11
11
class PyColorSettingsPage : PythonColorsPage () {
12
12
companion object {
13
13
private val ATTRIBUTES : Array <AttributesDescriptor ?> = arrayOf(
14
- AttributesDescriptor (" SecondaryKeywords" , PyAnnotator .SECONDARY_KEYWORD ),
15
- AttributesDescriptor (" SecondaryKeywordsBg" , PyAnnotator .SECONDARY_KEYWORD_WITH_BG ),
14
+ AttributesDescriptor (" Secondary keywords" , PyAnnotator .SECONDARY_KEYWORD ),
15
+ AttributesDescriptor (" Secondary keywords with Bg" , PyAnnotator .SECONDARY_KEYWORD_WITH_BG ),
16
+ AttributesDescriptor (" Import reference with Bg" , PyAnnotator .IMPORT_REFERENCE_WITH_BG ),
16
17
)
17
18
val DESCRIPTORS = mutableMapOf<String , TextAttributesKey >()
18
19
}
@@ -25,6 +26,7 @@ class PyColorSettingsPage : PythonColorsPage() {
25
26
val descriptors: MutableMap <String , TextAttributesKey > = HashMap ()
26
27
descriptors[" secondaryKeyword" ] = PyAnnotator .SECONDARY_KEYWORD
27
28
descriptors[" secondaryKeywordBg" ] = PyAnnotator .SECONDARY_KEYWORD_WITH_BG
29
+ descriptors[" importReference" ] = PyAnnotator .IMPORT_REFERENCE_WITH_BG
28
30
return descriptors
29
31
}
30
32
@@ -34,18 +36,19 @@ class PyColorSettingsPage : PythonColorsPage() {
34
36
35
37
override fun getDemoText (): String {
36
38
return """
37
- <secondaryKeyword>from</secondaryKeyword> flask <secondaryKeyword>import</secondaryKeyword> work
38
- <secondaryKeyword>import</secondaryKeyword> string
39
+ <secondaryKeyword>from</secondaryKeyword> <importReference>flask</importReference> <secondaryKeyword>import</secondaryKeyword> <importReference>work</importReference>
40
+ <secondaryKeyword>from</secondaryKeyword> <importReference>Something</importReference>, <importReference>Something2</importReference> <secondaryKeyword>import</secondaryKeyword> <importReference>work</importReference>
41
+ <secondaryKeyword>import</secondaryKeyword> <importReference>string</importReference>
39
42
40
- @app. get("/hello/somename")
41
- <secondaryKeywordBg>async</secondaryKeywordBg> def say_bye( name: bool):
42
- <secondaryKeyword>return</secondaryKeyword> {"message": f"bye {name}"}
43
+ @<decorator> app</decorator>.<nestedFuncDef> get</nestedFuncDef> ("/hello/somename")
44
+ <secondaryKeywordBg>async</secondaryKeywordBg> def <nestedFuncDef> say_bye</nestedFuncDef>(<kwarg> name</kwarg>: <classDef> bool</classDef> ):
45
+ <secondaryKeyword>return</secondaryKeyword> {"message": f"bye {<kwarg> name</kwarg> }"}
43
46
44
47
45
- @app. get("/hello/{name}")
46
- <secondaryKeywordBg>async</secondaryKeywordBg> def say_hello( name: bool):
47
- <secondaryKeywordBg>await</secondaryKeywordBg> say_bye( name)
48
- <secondaryKeyword>return</secondaryKeyword> {"message": f"Hello {name}"}
48
+ @<decorator> app</decorator>.<nestedFuncDef> get</nestedFuncDef> ("/hello/{name}")
49
+ <secondaryKeywordBg>async</secondaryKeywordBg> def <nestedFuncDef> say_hello</nestedFuncDef>(<kwarg> name</kwarg> : bool):
50
+ <secondaryKeywordBg>await</secondaryKeywordBg> <nestedFuncDef> say_bye</nestedFuncDef>(<kwarg> name</kwarg> )
51
+ <secondaryKeyword>return</secondaryKeyword> {"message": f"Hello {<kwarg> name</kwarg> }"}
49
52
50
53
""" .trimIndent() + super .getDemoText()
51
54
}
0 commit comments