Skip to content

Commit 0ea741c

Browse files
committed
refactor: simplify TextMate grammar and add Darcula theme
Remove redundant class-definition pattern from grammar. Add Darcula theme for consistent color scheme.
1 parent 9f639d1 commit 0ea741c

File tree

2 files changed

+122
-23
lines changed

2 files changed

+122
-23
lines changed

src/main/resources/textmate-bundle/syntaxes/t-ruby.tmLanguage.json

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
{ "include": "#comments" },
88
{ "include": "#type-alias" },
99
{ "include": "#interface" },
10-
{ "include": "#class-definition" },
1110
{ "include": "#function-definition" },
1211
{ "include": "#function-definition-no-params" },
1312
{ "include": "#method-call" },
@@ -67,28 +66,6 @@
6766
}
6867
]
6968
},
70-
"class-definition": {
71-
"patterns": [
72-
{
73-
"name": "meta.class.t-ruby",
74-
"match": "^\\s*(class)\\s+([A-Z]\\w*)(?:\\s*(<)\\s*([A-Z]\\w*))?",
75-
"captures": {
76-
"1": { "name": "keyword.declaration.class.t-ruby" },
77-
"2": { "name": "entity.name.type.class.t-ruby" },
78-
"3": { "name": "punctuation.definition.inheritance.t-ruby" },
79-
"4": { "name": "entity.other.inherited-class.t-ruby" }
80-
}
81-
},
82-
{
83-
"name": "meta.module.t-ruby",
84-
"match": "^\\s*(module)\\s+([A-Z]\\w*)",
85-
"captures": {
86-
"1": { "name": "keyword.declaration.module.t-ruby" },
87-
"2": { "name": "entity.name.type.module.t-ruby" }
88-
}
89-
}
90-
]
91-
},
9269
"interface-member": {
9370
"patterns": [
9471
{
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
{
2+
"name": "T-Ruby Darcula",
3+
"type": "dark",
4+
"tokenColors": [
5+
{
6+
"scope": [
7+
"keyword",
8+
"keyword.control",
9+
"keyword.control.class",
10+
"keyword.control.module",
11+
"keyword.control.def",
12+
"keyword.other.special-method",
13+
"constant.language",
14+
"constant.language.nil",
15+
"constant.language.boolean",
16+
"variable.language.self",
17+
"storage",
18+
"storage.type"
19+
],
20+
"settings": {
21+
"foreground": "#CC7832",
22+
"fontStyle": "bold"
23+
}
24+
},
25+
{
26+
"scope": [
27+
"entity.name.type",
28+
"entity.name.type.class",
29+
"entity.name.type.module",
30+
"entity.name.function",
31+
"entity.other.inherited-class",
32+
"support.class",
33+
"support.function"
34+
],
35+
"settings": {
36+
"foreground": "#FFC66D"
37+
}
38+
},
39+
{
40+
"scope": [
41+
"string",
42+
"string.quoted",
43+
"string.quoted.double",
44+
"string.quoted.single",
45+
"string.quoted.double.interpolated",
46+
"string.regexp"
47+
],
48+
"settings": {
49+
"foreground": "#6A8759"
50+
}
51+
},
52+
{
53+
"scope": [
54+
"variable.other.readwrite.instance",
55+
"variable.other.readwrite.class",
56+
"variable.other.readwrite.global",
57+
"variable.other.constant"
58+
],
59+
"settings": {
60+
"foreground": "#9876AA"
61+
}
62+
},
63+
{
64+
"scope": [
65+
"comment",
66+
"comment.line",
67+
"comment.block"
68+
],
69+
"settings": {
70+
"foreground": "#808080",
71+
"fontStyle": "italic"
72+
}
73+
},
74+
{
75+
"scope": [
76+
"constant.numeric",
77+
"constant.numeric.integer",
78+
"constant.numeric.float"
79+
],
80+
"settings": {
81+
"foreground": "#6897BB"
82+
}
83+
},
84+
{
85+
"scope": [
86+
"constant.language.symbol",
87+
"constant.other.symbol"
88+
],
89+
"settings": {
90+
"foreground": "#A5C261"
91+
}
92+
},
93+
{
94+
"scope": [
95+
"variable",
96+
"meta.class",
97+
"meta.module",
98+
"punctuation",
99+
"source"
100+
],
101+
"settings": {
102+
"foreground": "#A9B7C6"
103+
}
104+
},
105+
{
106+
"scope": [
107+
"meta.embedded.line",
108+
"punctuation.section.embedded"
109+
],
110+
"settings": {
111+
"foreground": "#CC7832"
112+
}
113+
},
114+
{
115+
"scope": "invalid.deprecated",
116+
"settings": {
117+
"foreground": "#FF6B68",
118+
"fontStyle": "strikethrough"
119+
}
120+
}
121+
]
122+
}

0 commit comments

Comments
 (0)