From 257d0d3a2514ac0ceaeaab095aee0249eed23c72 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 27 Jan 2014 11:02:52 -0800 Subject: [PATCH 1/6] Remove template snippets folder --- dot-atom/snippets/coffee.cson | 44 ----------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 dot-atom/snippets/coffee.cson diff --git a/dot-atom/snippets/coffee.cson b/dot-atom/snippets/coffee.cson deleted file mode 100644 index 5421f12f4..000000000 --- a/dot-atom/snippets/coffee.cson +++ /dev/null @@ -1,44 +0,0 @@ -".source.coffee": - "Describe block": - prefix: "de" - body: """ - describe "${1:description}", -> - ${2:body} - """ - "It block": - prefix: "i" - body: """ - it "$1", -> - $2 - """ - "Before each": - prefix: "be" - body: """ - beforeEach -> - $1 - """ - "After each": - prefix: "af" - body: """ - afterEach -> - $1 - """ - "Expectation": - prefix: "ex" - body: "expect($1).to$2" - "Console log": - prefix: "log" - body: "console.log $1" - "Range array": - prefix: "ra" - body: "[[$1, $2], [$3, $4]]" - "Point array": - prefix: "pt" - body: "[$1, $2]" - - "Key-value pair": - prefix: ":" - body: '${1:"${2:key}"}: ${3:value}' - "Create Jasmine spy": - prefix: "spy" - body: 'jasmine.createSpy("${1:description}")$2' From e6e7106ac5bc961cd0e209c2a8cfc1c10fc183d9 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 27 Jan 2014 11:16:24 -0800 Subject: [PATCH 2/6] Add sample snippets.cson to dot-atom template --- dot-atom/snippets.cson | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 dot-atom/snippets.cson diff --git a/dot-atom/snippets.cson b/dot-atom/snippets.cson new file mode 100644 index 000000000..e9d644de1 --- /dev/null +++ b/dot-atom/snippets.cson @@ -0,0 +1,15 @@ +# Your snippets +# +# Atom snippets allow you to enter a simple prefix in the editor and hit tab to +# expand the prefix into a larger code block with templated values. +# +# You can create a new snippet in this file by typing `snip` and then hitting +# tab. +# +# An example CoffeeScript snippet to expand log to console.log: +# +# '.source.coffee': +# 'Console log': +# 'prefix': 'log' +# 'body': 'console.log $1' +# From 5eb8875ad2ea89140e0f2886c2b2a057736077ef Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 27 Jan 2014 11:17:20 -0800 Subject: [PATCH 3/6] Add Open Your Snippets menu item --- menus/darwin.cson | 1 + src/browser/atom-application.coffee | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/menus/darwin.cson b/menus/darwin.cson index 24490bfa3..44e88dead 100644 --- a/menus/darwin.cson +++ b/menus/darwin.cson @@ -9,6 +9,7 @@ { label: 'Preferences...', command: 'application:show-settings' } { label: 'Open Your Config', command: 'application:open-your-config' } { label: 'Open Your Keymap', command: 'application:open-your-keymap' } + { label: 'Open Your Snippets', command: 'application:open-your-snippets' } { label: 'Open Your Stylesheet', command: 'application:open-your-stylesheet' } { type: 'separator' } { label: 'Install Shell Commands', command: 'window:install-shell-commands' } diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index bca05312e..affabc0ae 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -149,9 +149,10 @@ class AtomApplication @on 'application:report-issue', -> shell.openExternal('https://github.com/atom/atom/issues/new') @openPathOnEvent('application:show-settings', 'atom://config') - @openPathOnEvent('application:open-your-stylesheet', 'atom://.atom/stylesheet') - @openPathOnEvent('application:open-your-keymap', 'atom://.atom/keymap') @openPathOnEvent('application:open-your-config', 'atom://.atom/config') + @openPathOnEvent('application:open-your-keymap', 'atom://.atom/keymap') + @openPathOnEvent('application:open-your-snippets', 'atom://.atom/snippets') + @openPathOnEvent('application:open-your-stylesheet', 'atom://.atom/stylesheet') app.on 'window-all-closed', -> app.quit() if process.platform is 'win32' From a67d6362c25f815de8dfc653141374cee2e68f36 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 27 Jan 2014 12:50:57 -0800 Subject: [PATCH 4/6] Assert snippet.cson is copied over --- spec/config-spec.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/config-spec.coffee b/spec/config-spec.coffee index 13785568f..77455c5c2 100644 --- a/spec/config-spec.coffee +++ b/spec/config-spec.coffee @@ -218,7 +218,7 @@ describe "Config", -> runs -> expect(fs.existsSync(atom.config.configDirPath)).toBeTruthy() expect(fs.existsSync(path.join(atom.config.configDirPath, 'packages'))).toBeTruthy() - expect(fs.existsSync(path.join(atom.config.configDirPath, 'snippets'))).toBeTruthy() + expect(fs.isFileSync(path.join(atom.config.configDirPath, 'snippets.cson'))).toBeTruthy() expect(fs.isFileSync(path.join(atom.config.configDirPath, 'config.cson'))).toBeTruthy() describe ".loadUserConfig()", -> From cb0e0751d83713f1a54ee7a17fbda4d99f9c18a8 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 27 Jan 2014 12:58:46 -0800 Subject: [PATCH 5/6] Upgrade to snippets@0.21.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7fff783d6..9a95d8d13 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "package-generator": "0.24.0", "release-notes": "0.17.0", "settings-view": "0.57.0", - "snippets": "0.20.0", + "snippets": "0.21.0", "spell-check": "0.20.0", "status-bar": "0.32.0", "styleguide": "0.21.0", From 5b39fc2e11e834deab64112020705e74da8d4b91 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 27 Jan 2014 13:06:27 -0800 Subject: [PATCH 6/6] Upgrade to language-coffee-script@0.6.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9a95d8d13..2bbb39cfa 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "wrap-guide": "0.12.0", "language-c": "0.2.0", "language-clojure": "0.1.0", - "language-coffee-script": "0.5.0", + "language-coffee-script": "0.6.0", "language-css": "0.2.0", "language-gfm": "0.12.0", "language-git": "0.3.0",