Skip to content

Commit 9e5033a

Browse files
committed
[Refactor] Migrated syntax highlighting config file to resources
1 parent d232632 commit 9e5033a

File tree

7 files changed

+42
-0
lines changed

7 files changed

+42
-0
lines changed

resources.qrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,11 @@
22
<qresource prefix="/">
33
<file>resources/app_icon.png</file>
44
<file>resources/themes/dark.qss</file>
5+
<file>resources/syntax/cxx.syntax.yaml</file>
6+
<file>resources/syntax/python.syntax.yaml</file>
7+
<file>resources/syntax/go.syntax.yaml</file>
8+
<file>resources/syntax/tsx.syntax.yaml</file>
9+
<file>resources/syntax/yaml.syntax.yaml</file>
10+
<file>resources/syntax/markdown.syntax.yaml</file>
511
</qresource>
612
</RCC>

resources/syntax/tsx.syntax.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
extensions: [tsx, ts, js]
2+
3+
keywords:
4+
comment:
5+
- regex: "//.*"
6+
color: "#6A9955" # Green
7+
- regex: "/\\*[^*]*\\*+(?:[^/*][^*]*\\*+)*/"
8+
color: "#6A9955" # Green
9+
10+
string:
11+
- regex: "'(?:\\\\.|[^'\\\\])*'"
12+
color: "#CE9178" # Reddish
13+
- regex: "\"(?:\\\\.|[^\"\\\\])*\""
14+
color: "#CE9178" # Reddish
15+
- regex: "`(?:\\\\.|[^`\\\\])*`"
16+
color: "#DCDCAA" # Yellow for template literals
17+
18+
number:
19+
- regex: "\\b\\d+(\\.\\d+)?\\b"
20+
color: "#B5CEA8" # Light green
21+
22+
keyword:
23+
- regex: "\\b(?:let|const|var|function|class|interface|extends|implements|public|private|protected|static|new|return|if|else|for|while|do|switch|case|break|continue|try|catch|finally|throw|typeof|instanceof|in|of|void|async|await|import|from|export|default|as|enum|type|declare|namespace|abstract|readonly|get|set|yield|with|super|this)\\b"
24+
color: "#569CD6" # Blue
25+
26+
type:
27+
- regex: "\\b(?:string|number|boolean|any|unknown|never|void|object|undefined|null|bigint|symbol)\\b"
28+
color: "#4EC9B0" # Cyan
29+
30+
boolean:
31+
- regex: "\\b(?:true|false)\\b"
32+
color: "#569CD6" # Blue
33+
34+
operator:
35+
- regex: "\\+|-|\\*|\\/|=|==|===|!=|!==|<|>|<=|>=|\\?|:|\\.|,|\\||&|\\^|~|!"
36+
color: "#D4D4D4" # Light gray

0 commit comments

Comments
 (0)