Add structured coroutines and explicit error handling

This commit is contained in:
pavel 2026-08-27 16:26:40 +02:00
commit fe62e81152
31 changed files with 1701 additions and 325 deletions

View file

@ -142,14 +142,6 @@
"2": { "name": "entity.name.type.interface.gotlin" }
}
},
{
"name": "meta.worker.gotlin",
"match": "\\b(worker)\\s+([A-Za-z_][A-Za-z0-9_]*)",
"captures": {
"1": { "name": "storage.type.worker.gotlin" },
"2": { "name": "entity.name.type.worker.gotlin" }
}
},
{
"name": "meta.enum.gotlin",
"match": "\\b(enum)\\s+([A-Za-z_][A-Za-z0-9_]*)",
@ -262,7 +254,7 @@
"patterns": [
{
"name": "keyword.control.declaration.gotlin",
"match": "\\b(package|import|data|class|interface|worker|enum|fun)\\b"
"match": "\\b(package|import|data|class|interface|enum|suspend|fun)\\b"
},
{
"name": "storage.modifier.gotlin",
@ -282,7 +274,7 @@
},
{
"name": "keyword.control.concurrency.gotlin",
"match": "\\b(select|go|defer)\\b"
"match": "\\b(select|defer|runBlocking|coroutineScope|launch|async|await|delay|withTimeout|isActive)\\b"
},
{
"name": "keyword.control.exception.gotlin",
@ -298,7 +290,7 @@
"patterns": [
{
"name": "support.type.builtin.gotlin",
"match": "\\b(Int|String|Boolean|Unit|Double|Float|Any|ByteSlice|List|MutableList|Map|MutableMap|Channel|GotlinSQLQuery|GotlinSQLIterator)\\b"
"match": "\\b(Int|Long|String|Boolean|Unit|Double|Float|Any|Error|Result|ByteSlice|List|MutableList|Map|MutableMap|Channel|GotlinSQLQuery|GotlinSQLIterator)\\b"
},
{
"name": "support.type.qualified.gotlin",
@ -324,6 +316,14 @@
},
"typeOperators": {
"patterns": [
{
"name": "keyword.operator.nullsafe.gotlin",
"match": "\\?\\.|!!"
},
{
"name": "keyword.operator.error-propagation.gotlin",
"match": "(?<=[a-z0-9_)\\]])\\?(?!\\.)"
},
{
"name": "keyword.operator.type.nullable.gotlin",
"match": "(?<=[A-Za-z0-9_>])\\?"