diff --git a/vscode-ext/package.json b/vscode-ext/package.json index ab4f957..db77fa2 100644 --- a/vscode-ext/package.json +++ b/vscode-ext/package.json @@ -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" + } ] } } \ No newline at end of file diff --git a/vscode-ext/snippets.json b/vscode-ext/snippets.json new file mode 100644 index 0000000..54a0e73 --- /dev/null +++ b/vscode-ext/snippets.json @@ -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" + } +} \ No newline at end of file