Skip to content

Commit

Permalink
feat: update snippet prefix for jsx snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
afiiif committed Jul 15, 2024
1 parent e1374d5 commit d37576d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
14 changes: 7 additions & 7 deletions snippets/javascript.json
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@
"scope": "javascript,javascriptreact"
},
"🟨 jsxWrap": {
"prefix": "_rFrag.$_rFrag._frag._jsxFrag",
"prefix": "_jsxFrag.$_jsxFrag._frag._rFrag",
"body": [
"<$1$0>",
"\t$TM_SELECTED_TEXT",
Expand All @@ -1289,7 +1289,7 @@
"scope": "javascript,javascriptreact"
},
"🟨 jsxIf": {
"prefix": "_rIf.$_rIf._jsxIf",
"prefix": "_jsxIf.$_jsxIf._rIf",
"body": [
"{${1:condition} ? (",
"\t$TM_SELECTED_TEXT",
Expand All @@ -1301,7 +1301,7 @@
"scope": "javascript,javascriptreact"
},
"🟨 jsxIfWithFragment": {
"prefix": "_rIfFrag.$_rIfFrag._jsxIfFrag",
"prefix": "_jsxIfFrag.$_jsxIfFrag._rIfFrag",
"body": [
"{${1:condition} ? (",
"\t<>",
Expand All @@ -1315,7 +1315,7 @@
"scope": "javascript,javascriptreact"
},
"🟨 jsxElse": {
"prefix": "_rEl.$_rEl._jsxEl",
"prefix": "_jsxEl.$_jsxEl._rEl",
"body": [
"{${1:condition} ? (",
"\t${0:null}",
Expand All @@ -1327,7 +1327,7 @@
"scope": "javascript,javascriptreact"
},
"🟨 jsxElseWithFragment": {
"prefix": "_rElFrag.$_rElFrag._jsxElFrag",
"prefix": "_jsxElFrag.$_jsxElFrag._rElFrag",
"body": [
"{${1:condition} ? (",
"\t${0:null}",
Expand All @@ -1341,7 +1341,7 @@
"scope": "javascript,javascriptreact"
},
"🟨 jsxConditional": {
"prefix": "_rCond.$_rCond._jsxCond",
"prefix": "_jsxCond.$_jsxCond._rCond",
"body": [
"{${1:condition} && (",
"\t$TM_SELECTED_TEXT",
Expand All @@ -1351,7 +1351,7 @@
"scope": "javascript,javascriptreact"
},
"🟨 jsxConditionalWithFragment": {
"prefix": "_rCondFrag.$_rCondFrag._jsxCondFrag",
"prefix": "_jsxCondFrag.$_jsxCondFrag._rCondFrag",
"body": [
"{${1:condition} && (",
"\t<>",
Expand Down
14 changes: 7 additions & 7 deletions snippets/jsx.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"🟨 jsxWrap": {
"prefix": "_rFrag.$_rFrag._frag._jsxFrag",
"prefix": "_jsxFrag.$_jsxFrag._frag._rFrag",
"body": [
"<$1$0>",
"\t$TM_SELECTED_TEXT",
Expand All @@ -10,7 +10,7 @@
"scope": "astro"
},
"🟨 jsxIf": {
"prefix": "_rIf.$_rIf._jsxIf",
"prefix": "_jsxIf.$_jsxIf._rIf",
"body": [
"{${1:condition} ? (",
"\t$TM_SELECTED_TEXT",
Expand All @@ -22,7 +22,7 @@
"scope": "astro"
},
"🟨 jsxIfWithFragment": {
"prefix": "_rIfFrag.$_rIfFrag._jsxIfFrag",
"prefix": "_jsxIfFrag.$_jsxIfFrag._rIfFrag",
"body": [
"{${1:condition} ? (",
"\t<>",
Expand All @@ -36,7 +36,7 @@
"scope": "astro"
},
"🟨 jsxElse": {
"prefix": "_rEl.$_rEl._jsxEl",
"prefix": "_jsxEl.$_jsxEl._rEl",
"body": [
"{${1:condition} ? (",
"\t${0:null}",
Expand All @@ -48,7 +48,7 @@
"scope": "astro"
},
"🟨 jsxElseWithFragment": {
"prefix": "_rElFrag.$_rElFrag._jsxElFrag",
"prefix": "_jsxElFrag.$_jsxElFrag._rElFrag",
"body": [
"{${1:condition} ? (",
"\t${0:null}",
Expand All @@ -62,7 +62,7 @@
"scope": "astro"
},
"🟨 jsxConditional": {
"prefix": "_rCond.$_rCond._jsxCond",
"prefix": "_jsxCond.$_jsxCond._rCond",
"body": [
"{${1:condition} && (",
"\t$TM_SELECTED_TEXT",
Expand All @@ -72,7 +72,7 @@
"scope": "astro"
},
"🟨 jsxConditionalWithFragment": {
"prefix": "_rCondFrag.$_rCondFrag._jsxCondFrag",
"prefix": "_jsxCondFrag.$_jsxCondFrag._rCondFrag",
"body": [
"{${1:condition} && (",
"\t<>",
Expand Down
14 changes: 7 additions & 7 deletions snippets/typescript.json
Original file line number Diff line number Diff line change
Expand Up @@ -1587,7 +1587,7 @@
"scope": "javascript,typescript,javascriptreact,typescriptreact"
},
"🟨 jsxWrap": {
"prefix": "_rFrag.$_rFrag._frag._jsxFrag",
"prefix": "_jsxFrag.$_jsxFrag._frag._rFrag",
"body": [
"<$1$0>",
"\t$TM_SELECTED_TEXT",
Expand All @@ -1597,7 +1597,7 @@
"scope": "javascript,typescript,javascriptreact,typescriptreact"
},
"🟨 jsxIf": {
"prefix": "_rIf.$_rIf._jsxIf",
"prefix": "_jsxIf.$_jsxIf._rIf",
"body": [
"{${1:condition} ? (",
"\t$TM_SELECTED_TEXT",
Expand All @@ -1609,7 +1609,7 @@
"scope": "javascript,typescript,javascriptreact,typescriptreact"
},
"🟨 jsxIfWithFragment": {
"prefix": "_rIfFrag.$_rIfFrag._jsxIfFrag",
"prefix": "_jsxIfFrag.$_jsxIfFrag._rIfFrag",
"body": [
"{${1:condition} ? (",
"\t<>",
Expand All @@ -1623,7 +1623,7 @@
"scope": "javascript,typescript,javascriptreact,typescriptreact"
},
"🟨 jsxElse": {
"prefix": "_rEl.$_rEl._jsxEl",
"prefix": "_jsxEl.$_jsxEl._rEl",
"body": [
"{${1:condition} ? (",
"\t${0:null}",
Expand All @@ -1635,7 +1635,7 @@
"scope": "javascript,typescript,javascriptreact,typescriptreact"
},
"🟨 jsxElseWithFragment": {
"prefix": "_rElFrag.$_rElFrag._jsxElFrag",
"prefix": "_jsxElFrag.$_jsxElFrag._rElFrag",
"body": [
"{${1:condition} ? (",
"\t${0:null}",
Expand All @@ -1649,7 +1649,7 @@
"scope": "javascript,typescript,javascriptreact,typescriptreact"
},
"🟨 jsxConditional": {
"prefix": "_rCond.$_rCond._jsxCond",
"prefix": "_jsxCond.$_jsxCond._rCond",
"body": [
"{${1:condition} && (",
"\t$TM_SELECTED_TEXT",
Expand All @@ -1659,7 +1659,7 @@
"scope": "javascript,typescript,javascriptreact,typescriptreact"
},
"🟨 jsxConditionalWithFragment": {
"prefix": "_rCondFrag.$_rCondFrag._jsxCondFrag",
"prefix": "_jsxCondFrag.$_jsxCondFrag._rCondFrag",
"body": [
"{${1:condition} && (",
"\t<>",
Expand Down
14 changes: 7 additions & 7 deletions src/snippets/html-jsx.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { Snippet } from '../types';

export const jsxWrap: Snippet = {
prefix: ['_rFrag', '_frag', '_jsxFrag'],
prefix: ['_jsxFrag', '_frag', '_rFrag'],
body: ['<$1$0>', '\t$TM_SELECTED_TEXT', '</$1>'],
description: 'Wrap component with Fragment',
};

export const jsxIf: Snippet = {
prefix: ['_rIf', '_jsxIf'],
prefix: ['_jsxIf', '_rIf'],
body: ['{${1:condition} ? (', '\t$TM_SELECTED_TEXT', ') : (', '\t${0:null}', ')}'],
description: 'Wrap in if',
};

export const jsxIfWithFragment: Snippet = {
prefix: ['_rIfFrag', '_jsxIfFrag'],
prefix: ['_jsxIfFrag', '_rIfFrag'],
body: [
'{${1:condition} ? (',
'\t<>',
Expand All @@ -27,13 +27,13 @@ export const jsxIfWithFragment: Snippet = {
};

export const jsxElse: Snippet = {
prefix: ['_rEl', '_jsxEl'],
prefix: ['_jsxEl', '_rEl'],
body: ['{${1:condition} ? (', '\t${0:null}', ') : (', '\t$TM_SELECTED_TEXT', ')}'],
description: 'Wrap in else',
};

export const jsxElseWithFragment: Snippet = {
prefix: ['_rElFrag', '_jsxElFrag'],
prefix: ['_jsxElFrag', '_rElFrag'],
body: [
'{${1:condition} ? (',
'\t${0:null}',
Expand All @@ -47,13 +47,13 @@ export const jsxElseWithFragment: Snippet = {
};

export const jsxConditional: Snippet = {
prefix: ['_rCond', '_jsxCond'],
prefix: ['_jsxCond', '_rCond'],
body: ['{${1:condition} && (', '\t$TM_SELECTED_TEXT', ')}'],
description: 'Wrap with conditional',
};

export const jsxConditionalWithFragment: Snippet = {
prefix: ['_rCondFrag', '_jsxCondFrag'],
prefix: ['_jsxCondFrag', '_rCondFrag'],
body: ['{${1:condition} && (', '\t<>', '\t\t$TM_SELECTED_TEXT', '\t</>', ')}'],
description: 'Wrap with conditional',
};
Expand Down

0 comments on commit d37576d

Please sign in to comment.