-
-
Notifications
You must be signed in to change notification settings - Fork 92
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Input:
{
"mobxConstructor": {
"definitions": [
{
"scope": {
"langIds": [
"typescript",
"javascript",
"typescriptreact",
"javascriptreact"
]
},
"body": [
"constructor($parameters) {",
"\tmakeAutoObservable(this);",
"}"
]
}
],
"description": "Constructor using makeAutoObservable",
"insertionScopeTypes": [
"namedFunction"
]
},
"constantDeclaration": {
"definitions": [
{
"scope": {
"langIds": [
"typescript",
"javascript",
"typescriptreact",
"javascriptreact"
]
},
"body": [
"const $name = ${value/^([^;]*);?$/$1/};"
],
"variables": {
"name": {
"formatter": "camelCase"
}
}
}
],
"description": "Constant variable declaration",
"insertionScopeTypes": [
"statement"
],
"variables": {
"value": {
"wrapperScopeType": "statement"
}
}
},
"constantDeclarationWithType": {
"definitions": [
{
"scope": {
"langIds": [
"typescript",
"javascript",
"typescriptreact",
"javascriptreact"
]
},
"body": [
"const $name: $type = ${value/^([^;]*);?$/$1/};"
],
"variables": {
"name": {
"formatter": "camelCase"
}
}
}
],
"description": "Constant variable declaration with type",
"insertionScopeTypes": [
"statement"
],
"variables": {
"value": {
"wrapperScopeType": "statement"
}
}
},
"letDeclaration": {
"definitions": [
{
"scope": {
"langIds": [
"typescript",
"javascript",
"typescriptreact",
"javascriptreact"
]
},
"body": [
"let $name = ${value/^([^;]*);?$/$1/};"
],
"variables": {
"name": {
"formatter": "camelCase"
}
}
}
],
"description": "Let variable declaration",
"insertionScopeTypes": [
"statement"
],
"variables": {
"value": {
"wrapperScopeType": "statement"
}
}
},
"letDeclarationWithType": {
"definitions": [
{
"scope": {
"langIds": [
"typescript",
"javascript",
"typescriptreact",
"javascriptreact"
]
},
"body": [
"let $name: $type = ${value/^([^;]*);?$/$1/};"
],
"variables": {
"name": {
"formatter": "camelCase"
}
}
}
],
"description": "Let variable declaration with type",
"insertionScopeTypes": [
"statement"
],
"variables": {
"value": {
"wrapperScopeType": "statement"
}
}
}
}Output:
name: letDeclarationWithType
description: Let variable declaration with type
phrase: let type
insertionScope: statement
$value.wrapperPhrase: let type
$value.wrapperScope: statement
---
language: typescript | javascript | typescriptreact | javascriptreact
-
constructor($parameters) {
makeAutoObservable(this);
}
---
language: typescript | javascript | typescriptreact | javascriptreact
$name.insertionFormatter: PRIVATE_CAMEL_CASE
-
const $name = ${value/^([^;]*);?$/$1/};
---
language: typescript | javascript | typescriptreact | javascriptreact
$name.insertionFormatter: PRIVATE_CAMEL_CASE
-
const $name: $type = ${value/^([^;]*);?$/$1/};
---
language: typescript | javascript | typescriptreact | javascriptreact
$name.insertionFormatter: PRIVATE_CAMEL_CASE
-
let $name = ${value/^([^;]*);?$/$1/};
---
language: typescript | javascript | typescriptreact | javascriptreact
$name.insertionFormatter: PRIVATE_CAMEL_CASE
-
let $name: $type = ${value/^([^;]*);?$/$1/};
---
Note how for all fields other than language (eg name, description, etc) it just takes the value from the final snippet and puts them at the top of the file.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working