chore: add midas snippets

This commit is contained in:
2026-07-09 16:33:37 +02:00
parent c3b243288d
commit 60ff529226
2 changed files with 59 additions and 1 deletions

View File

@@ -4,7 +4,9 @@
"engines": {
"vscode": "*"
},
"categories": ["Programming Languages"],
"categories": [
"Programming Languages"
],
"contributes": {
"languages": [
{
@@ -24,6 +26,12 @@
"scopeName": "source.midas",
"path": "./syntaxes/midas.tmLanguage.json"
}
],
"snippets": [
{
"language": "midas",
"path": "./snippets.json"
}
]
}
}

50
vscode-ext/snippets.json Normal file
View File

@@ -0,0 +1,50 @@
{
"Type alias": {
"prefix": "alias",
"body": "alias ${1:name} = $0",
"description": "Declare a type alias"
},
"Derived type": {
"prefix": "type",
"body": "type ${1:name} = $0",
"description": "Declare a derived type"
},
"Predicate": {
"prefix": "predicate",
"body": "predicate ${1:signature} = $0",
"description": "Declare a predicate"
},
"Extend": {
"prefix": "extend",
"body": [
"extend ${1:type} {",
"\t$0",
"}"
],
"description": "Extend a type to add members"
},
"Property": {
"prefix": "prop",
"body": "prop ${1:name}: $0",
"description": "Declare a property"
},
"Method": {
"prefix": "def",
"body": "def ${1:name}: $0",
"description": "Declare a method"
},
"Function type": {
"prefix": "fn",
"body": "fn(${1:parameters}) -> ${2:returns}",
"description": "A function type"
},
"Frame type": {
"prefix": "frame",
"body": [
"Frame[",
"\t$0",
"]"
],
"description": "A frame type"
}
}