Skip to content

Commit

Permalink
feat: adding basic snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
jnoortheen committed Jul 13, 2020
1 parent 3113b30 commit 02e1995
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Adds [nix](https://nixos.org/) language support for VSCode Editor.
+ with the help of [nixpkgs-format](https://github.com/nix-community/nixpkgs-fmt)
* Error Report
+ Using `nix-instantiate`
* Snippets

## Installation

Expand Down
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"vscode": "^1.47.0"
},
"categories": [
"Programming Languages"
"Programming Languages",
"Snippets"
],
"bugs": {
"url": "https://github.com/jnoortheen/vscode-nix-ide/issues"
Expand Down Expand Up @@ -40,6 +41,12 @@
"scopeName": "source.nix",
"path": "./syntaxes/nix.tmLanguage.json"
}
],
"snippets": [
{
"language": "nix",
"path": "./snippets.json"
}
]
},
"devDependencies": {
Expand Down
22 changes: 22 additions & 0 deletions snippets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"conditional": {
"prefix": ["if"],
"body": ["if $1 then $2 else $0"],
"description": "Conditional expression"
},
"let": {
"prefix": ["let"],
"body": ["let $0;", "in"],
"description": "Let expression"
},
"rec": {
"prefix": ["rec"],
"body": ["rec { $1", "\t$0}"],
"description": "Recursive Set"
},
"with": {
"prefix": ["with"],
"body": ["with $0;"],
"description": "With expression"
}
}

0 comments on commit 02e1995

Please sign in to comment.