aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamian Tarnawski <gthetarnav@gmail.com>2023-06-18 20:45:01 +0200
committerDamian Tarnawski <gthetarnav@gmail.com>2023-06-18 20:45:01 +0200
commit574cddd80c614ba337b5fad178500f1bfd7a9506 (patch)
treebac91099188b16ff46a884c12a03b63d5671015f
parent73d4680a528aeea52a36020b920ce84ebc0298a9 (diff)
textmate improvements
Add `distinct` to `storage.type.odin`. Not sure if that's the right scope, but it get's colored correctly Add `context` to `variable.other.object.odin` Remove `assertf` and `panicf` from function builtins (they are from a module) Add procedute calls to `entity.name.function`. And a separate capture for `module.proc()` syntax
-rw-r--r--editors/vscode/syntaxes/odin.tmLanguage.json37
1 files changed, 20 insertions, 17 deletions
diff --git a/editors/vscode/syntaxes/odin.tmLanguage.json b/editors/vscode/syntaxes/odin.tmLanguage.json
index 8053eb8..d050eb9 100644
--- a/editors/vscode/syntaxes/odin.tmLanguage.json
+++ b/editors/vscode/syntaxes/odin.tmLanguage.json
@@ -112,8 +112,8 @@
"match": "\\b(asm)\\b"
},
{
- "name": "keyword.operator.odin",
- "match": "\\b(distinct|context)\\b"
+ "name": "variable.other.object.odin",
+ "match": "\\b(context)\\b"
},
{
"name": "constant.language.odin",
@@ -133,7 +133,7 @@
},
{
"name": "storage.type.odin",
- "match": "\\b(struct|enum|union|map|set|bit_set|typeid|matrix)\\b"
+ "match": "\\b(struct|enum|union|distinct|map|set|bit_set|typeid|matrix)\\b"
},
{
"name": "keyword.function.odin",
@@ -205,7 +205,7 @@
"name": "punctuation.odin"
}
},
- "match": "\\b(len|cap|make|resize|reserve|append|delete|assertf?|panicf?)\\b\\s*(\\()"
+ "match": "\\b(len|cap|make|resize|reserve|append|delete|assert|panic)\\b\\s*(\\()"
},
{
"captures": {
@@ -220,25 +220,28 @@
},
{
"captures": {
- "1": {
- "name": "support.function.odin"
- },
- "2": {
- "name": "punctuation.odin"
- }
+ "1": { "name": "variable.other.object" },
+ "2": { "name": "punctuation.accessor.odin" },
+ "3": { "name": "entity.name.function.odin" },
+ "4": { "name": "punctuation.odin" }
+ },
+ "match": "([A-Za-z_][A-Za-z0-9_]*)\\s*(\\.)\\s*([A-Za-z_][A-Za-z0-9_]*)\\s*[!]?\\s*([\\(])"
+ },
+ {
+ "captures": {
+ "1": { "name": "entity.name.function.odin" },
+ "2": { "name": "punctuation.odin" }
},
"match": "([A-Za-z_][A-Za-z0-9_]*)\\s*[!]?\\s*([\\(])"
},
{
"captures": {
- "1": {
- "name": "entity.name.type.odin"
- },
- "2": {
- "name": "storage.type.odin"
- }
+ "1": { "name": "entity.name.type.odin" },
+ "2": { "name": "keyword.operator.assignment.odin" },
+ "3": { "name": "keyword.operator.assignment.odin" },
+ "4": { "name": "storage.type.odin" }
},
- "match": "\\b([A-Za-z_][A-Za-z0-9_]*)\\s*[:]\\s*[:]\\s*(struct|union|enum|bit_set)"
+ "match": "\\b([A-Za-z_][A-Za-z0-9_]*)\\s*([:])\\s*([:])\\s*(struct|union|enum|bit_set)"
}
]
},