Add value-returning match expressions

This commit is contained in:
pavel 2026-08-27 17:56:13 +02:00
commit ab783c33ed
12 changed files with 384 additions and 14 deletions

View file

@ -80,6 +80,17 @@
],
"description": "Exhaustive match over enum variants"
},
"Exhaustive Match Expression": {
"prefix": "matchvalue",
"body": [
"val ${1:value} = match (${2:result}) {",
" ${3:Result}::${4:Success}(${5:item}) -> ${5:item}",
" ${3:Result}::${6:Failure}(${7:reason}) -> ${7:reason}",
" $0",
"}"
],
"description": "Return a typed value from an exhaustive enum match"
},
"Recursive Structural Mapping": {
"prefix": "mapto",
"body": ["val ${1:target} = ${2:source}.mapTo<${3:Target}>()"],