diff --git a/README.md b/README.md
index 2461468..9c7eace 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@ Preconfigured snippets for ember projects following Polaris Patterns.
- VSCode: https://marketplace.visualstudio.com/items?itemName=EmberTooling.emberjs-snippets
- Open VSX: https://open-vsx.org/extension/embertooling/emberjs-snippets
- (neo)vim:
- - packer.nvim: `use { "ember-tooling/snippets" }`
+ - packer.nvim: `use { "ember-tooling/snippets", branch: "neovim/main" }`
## Important
@@ -19,6 +19,17 @@ Preconfigured snippets for ember projects following Polaris Patterns.
This extension is optimized for developers that use Ember Polaris patterns and features, which are supported back to ember-source 3.28.
If you need Ember Octane (and earlier) snippets, this snippet pack is not for you.
+
+Main branches:
+- [VSCode][vscode-main]
+- [NeoVim][neovim-main]
+
+✨ Development happens on these branches ✨
+
+[vscode-main]: https://github.com/ember-tooling/snippets/tree/vscode/main
+[neovim-main]: https://github.com/ember-tooling/snippets/tree/neovim/main
+
+
## Usage
Many snippets will show up in auto-completion prompts as you're typing.
diff --git a/snippets/all-template-tag.json b/snippets/all-template-tag.json
deleted file mode 100644
index e28ac18..0000000
--- a/snippets/all-template-tag.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "await render": {
- "prefix": ["render", "await render"],
- "body": ["await render(", " ", " ${1}", " ", ");"]
- },
- "": {
- "prefix": ["temp", ""],
- "body": ["", " ${0}", ""]
- }
-}
diff --git a/snippets/all.json b/snippets/all.json
deleted file mode 100644
index 75c9d56..0000000
--- a/snippets/all.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "QUnit Module": {
- "prefix": ["module"],
- "body": ["module('${1}', function (hooks) {", " ${2}", "});"]
- },
- "QUnit Test": {
- "prefix": ["test"],
- "body": ["test('${1}', async function (assert) {", " ${2}", "});"]
- },
- "@cached getter": {
- "prefix": ["get", "@cached"],
- "body": ["@cached", "get ${1}() {", " ${2}", "}"]
- },
- "getter": {
- "prefix": ["get"],
- "body": ["get ${1}() {", " ${2}", "}"]
- },
- "getter + setter pair": {
- "prefix": ["get", "set"],
- "body": ["get ${1}() {", " ${2}", "}", "set ${1}(value) {", " ${3}", "}"]
- }
-}
diff --git a/snippets/javascript.glimmer.json b/snippets/javascript.glimmer.json
deleted file mode 100644
index 2dfab81..0000000
--- a/snippets/javascript.glimmer.json
+++ /dev/null
@@ -1,79 +0,0 @@
-{
- "class Component (file)": {
- "isFileTemplate": true,
- "prefix": ["g-class-component", "g-component", "class"],
- "body": [
- "import Component from '@glimmer/component';",
- "",
- "export class ${1} extends Component {",
- " ",
- " ${0}",
- " ",
- "}"
- ]
- },
-
- "template-only component (file)": {
- "isFileTemplate": true,
- "prefix": ["g-component", "const", "temp", ""],
- "body": [
- "export const ${0} = ",
- " ",
- " ${1}",
- " ;"
- ]
- },
- "route template(file)": {
- "isFileTemplate": true,
- "prefix": ["g-template", "const", "temp", ""],
- "body": ["export default ", " ", " ${1}", " "]
- },
- "class Component": {
- "prefix": ["class", "Component"],
- "body": [
- "import Component from '@glimmer/component';",
- "",
- "class ${1} extends Component {",
- " ",
- " ${0}",
- " ",
- "}"
- ]
- },
- "@tracked property": { "prefix": "@tracked", "body": "@tracked ${0};" },
- "const ": {
- "prefix": ["const", "temp", ""],
- "body": ["const ${0} = ", " ", " ${1}", " "]
- },
- "@service injection": { "prefix": "@service", "body": "@service ${1};" },
- "Rendering Test (file)": {
- "isFileTemplate": true,
- "prefix": ["g-rendering-test", "Rendering Test", "test"],
- "body": [
- "import { module, test } from 'qunit';",
- "import { setupRenderingTest } from 'ember-qunit';",
- "import { render } from '@ember/test-helpers';",
- "import { tracked } from '@glimmer/tracking';",
- "",
- "module('Rendering | ${1}', function (hooks) {",
- " setupRenderingTest(hooks);",
- "",
- " test('${2}', async function (assert) {",
- " class State {",
- " @tracked where = 'here';",
- " }",
- "",
- " let state = new State();",
- "",
- " await render(",
- " ",
- " content to test {{state.where}}",
- " ",
- " );",
- "",
- " assert.dom().hasText('content to test here');",
- " });",
- "});"
- ]
- }
-}
diff --git a/snippets/javascript.json b/snippets/javascript.json
deleted file mode 100644
index 9843952..0000000
--- a/snippets/javascript.json
+++ /dev/null
@@ -1,85 +0,0 @@
-{
- "Route (file)": {
- "isFileTemplate": true,
- "prefix": ["g-route"],
- "body": [
- "import Route from '@ember/routing/route';",
- "",
- "export default class ${0} extends Route {",
- " queryParams = {",
- " // foo: { refreshModel: true } ",
- " }",
- "",
- " async beforeModel(/* transition */) {}",
- " async model(/* params, transition */) {}",
- " async afterModel(/* model, transition */) {}",
- "}"
- ]
- },
- "Route w/ Router (file)": {
- "isFileTemplate": true,
- "prefix": ["g-route"],
- "body": [
- "import Route from '@ember/routing/route';",
- "import { service } from '@ember/service';",
- "",
- "export default class ${0} extends Route {",
- " @service router;",
- "",
- " queryParams = {",
- " // foo: { refreshModel: true } ",
- " }",
- "",
- " async beforeModel(/* transition */) {}",
- " async model(/* params, transition */) {}",
- " async afterModel(/* model, transition */) {}",
- "}"
- ]
- },
- "Service (file)": {
- "isFileTemplate": true,
- "prefix": ["g-service"],
- "body": [
- "import Service from '@ember/service';",
- "",
- "export default class ${0} extends Service {",
- " ${1}",
- "}"
- ]
- },
- "Unit Test (file)": {
- "isFileTemplate": true,
- "prefix": ["g-unit-test", "Unit Test", "test"],
- "body": [
- "import { module, test } from 'qunit';",
- "import { setupTest } from 'ember-qunit';",
- "",
- "module('Unit | ${1}', function (hooks) {",
- " setupTest(hooks);",
- "",
- " test('${2}', async function (assert) {",
- " assert.ok('true', 'we did it');",
- " });",
- "});"
- ]
- },
- "Application Test (file)": {
- "isFileTemplate": true,
- "prefix": ["g-application-test", "Application Test", "test"],
- "body": [
- "import { module, test } from 'qunit';",
- "import { setupApplicationTest } from 'ember-qunit';",
- "import { visit } from '@ember/test-helpers';",
- "",
- "module('Application | ${1}', function (hooks) {",
- " setupApplicationTest(hooks);",
- "",
- " test('${2}', async function (assert) {",
- " await visit('/some/location');",
- "",
- " assert.dom().hasText('content to test here');",
- " });",
- "});"
- ]
- }
-}
diff --git a/snippets/typescript.glimmer.json b/snippets/typescript.glimmer.json
deleted file mode 100644
index 134d94d..0000000
--- a/snippets/typescript.glimmer.json
+++ /dev/null
@@ -1,163 +0,0 @@
-{
- "class Component (file)": {
- "isFileTemplate": true,
- "prefix": ["g-class-component", "g-component", "class"],
- "body": [
- "import Component from '@glimmer/component';",
- "",
- "export class ${1} extends Component<{",
- " Element: null;",
- " Args: {",
- " // foo: number",
- " };",
- " Blocks: {",
- " // default: []",
- " }",
- "}> {",
- " ",
- " ${0}",
- " ",
- "}"
- ]
- },
-
- "template-only component (file)": {
- "isFileTemplate": true,
- "prefix": ["g-component", "const", "temp", ""],
- "body": [
- "import type { TOC } from '@ember/component/template-only';",
- "",
- "export const ${0} = ",
- " ",
- " ${1}",
- " satisfies TOC<{",
- " ${2}",
- " }>"
- ]
- },
- "route template(file)": {
- "isFileTemplate": true,
- "prefix": ["g-template", "const", "temp", ""],
- "body": [
- "import type { TOC } from '@ember/component/template-only';",
- "",
- "export default ",
- " ",
- " ${1}",
- " satisfies TOC<{",
- " ${2}",
- " }>"
- ]
- },
- "class Component": {
- "prefix": ["class", "Component"],
- "body": [
- "import Component from '@glimmer/component';",
- "",
- "class ${1} extends Component<{",
- " Element: null;",
- " Args: {",
- " };",
- " Blocks: {",
- " // default: []",
- " }",
- "}> {",
- " ",
- " ${0}",
- " ",
- "}"
- ]
- },
- "@tracked property": { "prefix": "@tracked", "body": "@tracked ${0};" },
- "const ": {
- "prefix": ["const", "temp", ""],
- "body": [
- "import type { TOC } from '@ember/component/template-only';",
- "",
- "const ${0} = ",
- " ",
- " ${1}",
- " satisfies TOC<{",
- " ${2}",
- " }>"
- ]
- },
- "@service injection": {
- "prefix": "@service",
- "body": "@service declare ${1}: ${0};"
- },
- "@service router": {
- "prefix": ["@service", "router"],
- "body": "@service declare router: RouterService;"
- },
- "Signature type": {
- "prefix": ["interface", "Signature"],
- "body": [
- "interface Signature {",
- " Element: null;",
- " Args: {",
- " // foo: number",
- " };",
- " Blocks: {",
- " // default: []",
- " };",
- "}"
- ]
- },
- "TOC type": {
- "prefix": "TOC",
- "body": [
- "TOC<{",
- " Element: null;",
- " Args: {",
- " // foo: number",
- " };",
- " Blocks: {",
- " // default: []",
- " };",
- "}>"
- ]
- },
- "Signature content": {
- "prefix": ["Args", "signature-content"],
- "body": [
- "Element: null;",
- "Args: {",
- " // foo: number",
- "}",
- "Blocks: {",
- " // default: []",
- "}"
- ]
- },
- "Rendering Test (file)": {
- "isFileTemplate": true,
- "prefix": ["g-rendering-test", "Rendering Test", "test"],
- "body": [
- "import { module, test } from 'qunit';",
- "import { setupRenderingTest } from 'ember-qunit';",
- "import { render } from '@ember/test-helpers';",
- "import { tracked } from '@glimmer/tracking';",
- "",
- "module('Rendering | ${1}', function (hooks) {",
- " setupRenderingTest(hooks);",
- "",
- " test('${2}', async function (assert) {",
- " class State {",
- " @tracked where = 'here';",
- " }",
- "",
- " let state = new State();",
- "",
- " await render(",
- " ",
- " content to test {{state.where}}",
- " ",
- " );",
- "",
- " assert.dom().hasText('content to test here');",
- " });",
- "});"
- ]
- }
-}
diff --git a/snippets/typescript.json b/snippets/typescript.json
deleted file mode 100644
index 47c0fd6..0000000
--- a/snippets/typescript.json
+++ /dev/null
@@ -1,96 +0,0 @@
-{
- "Route (file)": {
- "isFileTemplate": true,
- "prefix": ["g-route"],
- "body": [
- "import Route from '@ember/routing/route';",
- "import type Transition from '@ember/routing/transition';",
- "",
- "interface Params {",
- " // FIXME: Add params",
- "}",
- "",
- "export default class ${0} extends Route {",
- " queryParams = {",
- " // foo: { refreshModel: true } ",
- " }",
- "",
- " async beforeModel(transition: Transition) {}",
- " async model(params: Params, transition: Transition) {}",
- " async afterModel(/* model, transition */) {}",
- "}"
- ]
- },
- "Route w/ Router (file)": {
- "isFileTemplate": true,
- "prefix": ["g-route"],
- "body": [
- "import Route from '@ember/routing/route';",
- "import { service } from '@ember/service';",
- "import type Transition from '@ember/routing/transition';",
- "import type RouterService from '@ember/routing/router-service';",
- "",
- "interface Params {",
- " // FIXME: Add params",
- "}",
- "",
- "export default class ${0} extends Route {",
- " @service declare router: RouterService;",
- "",
- " queryParams = {",
- " // foo: { refreshModel: true } ",
- " }",
- "",
- " async beforeModel(transition: Transition) {}",
- " async model(params: Params, transition: Transition) {}",
- " async afterModel(/* model, transition */) {}",
- "}"
- ]
- },
- "Service (file)": {
- "isFileTemplate": true,
- "prefix": ["g-service"],
- "body": [
- "import Service from '@ember/service';",
- "",
- "export default class ${0} extends Service {",
- " ${1}",
- "}"
- ]
- },
- "Unit Test (file)": {
- "isFileTemplate": true,
- "prefix": ["g-unit-test", "Unit Test", "test"],
- "body": [
- "import { module, test } from 'qunit';",
- "import { setupTest } from 'ember-qunit';",
- "",
- "module('Unit | ${1}', function (hooks) {",
- " setupTest(hooks);",
- "",
- " test('${2}', async function (assert) {",
- " assert.ok('true', 'we did it');",
- " });",
- "});"
- ]
- },
- "Application Test (file)": {
- "isFileTemplate": true,
- "prefix": ["g-application-test", "Application Test", "test"],
- "body": [
- "import { module, test } from 'qunit';",
- "import { setupApplicationTest } from 'ember-qunit';",
- "import { visit } from '@ember/test-helpers';",
- "",
- "module('Application | ${1}', function (hooks) {",
- " setupApplicationTest(hooks);",
- "",
- " test('${2}', async function (assert) {",
- " await visit('/some/location');",
- "",
- " assert.dom().hasText('content to test here');",
- " });",
- "});"
- ]
- }
-}