Skip to content

Commit

Permalink
feat: update snippets for functions and methods (#769)
Browse files Browse the repository at this point in the history
### Summary of Changes

Update snippets for functions and methods to include calls of purity
annotations.

---------

Co-authored-by: megalinter-bot <[email protected]>
  • Loading branch information
lars-reimann and megalinter-bot authored Nov 13, 2023
1 parent a15b0af commit 061d3b1
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions packages/safe-ds-vscode/snippets/safe-ds.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,29 @@
"body": ["enum ${1:MyEnum} {", " $0", "}"],
"description": "An enumeration."
},
"Minimal Function": {
"prefix": ["minimal-function", "minimal-method"],
"body": ["fun ${1:myFunction}($0)"],
"description": "A minimal function."
"Minimal Pure Function": {
"prefix": ["minimal-pure-function"],
"body": ["@Pure", "fun ${1:myFunction}($0)"],
"description": "A minimal pure function."
},
"Function": {
"prefix": ["function", "method"],
"body": ["${1|static |}fun ${2:myFunction}${3:<$4>}($5) ${6:-> ($7)} ${8:where {$0\\}}"],
"prefix": ["function"],
"body": ["${1|@Pure,@Impure([])|}", "fun ${2:myFunction}${3:<$4>}($5) ${6:-> ($7)} ${8:where {$0\\}}"],
"description": "A function."
},
"Minimal Pure Method": {
"prefix": ["minimal-pure-method"],
"body": ["@Pure", "${1|static |}fun ${2:myMethod}($0)"],
"description": "A minimal pure method."
},
"Method": {
"prefix": ["method"],
"body": [
"${1|@Pure,@Impure([])|}",
"${2|static |}fun ${3:myMethod}${4:<$5>}($6) ${7:-> ($8)} ${9:where {$0\\}}"
],
"description": "A method."
},
"Schema": {
"prefix": ["schema"],
"body": ["schema ${1:MySchema} {", " $0", "}"],
Expand Down

0 comments on commit 061d3b1

Please sign in to comment.