From 02e199541e6db1f74c6a2de680957f81a9afa498 Mon Sep 17 00:00:00 2001 From: Noortheen Raja Date: Mon, 13 Jul 2020 06:22:49 +0530 Subject: [PATCH] feat: adding basic snippets --- README.md | 1 + package.json | 9 ++++++++- snippets.json | 22 ++++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 snippets.json diff --git a/README.md b/README.md index 904be23..48bd6a3 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/package.json b/package.json index f3ce140..8adcfff 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "vscode": "^1.47.0" }, "categories": [ - "Programming Languages" + "Programming Languages", + "Snippets" ], "bugs": { "url": "https://github.com/jnoortheen/vscode-nix-ide/issues" @@ -40,6 +41,12 @@ "scopeName": "source.nix", "path": "./syntaxes/nix.tmLanguage.json" } + ], + "snippets": [ + { + "language": "nix", + "path": "./snippets.json" + } ] }, "devDependencies": { diff --git a/snippets.json b/snippets.json new file mode 100644 index 0000000..d41bb28 --- /dev/null +++ b/snippets.json @@ -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" + } +}