-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Snippet migrator improperly handles multiple snippets in the same file #2836
Labels
bug
Something isn't working
Comments
Good catch. Looks like we didn't have a example of multiple difference snippet names in the same file. Hopefully this works better: |
github-merge-queue bot
pushed a commit
that referenced
this issue
Feb 10, 2025
… one file and noop phrase (#2838) Fixes #2836 Fixes #2840 Input ```json { "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: mobxConstructor description: Constructor using makeAutoObservable language: typescript | javascript | typescriptreact | javascriptreact insertionScope: namedFunction - constructor($parameters) { makeAutoObservable(this); } --- name: constantDeclaration description: Constant variable declaration language: typescript | javascript | typescriptreact | javascriptreact insertionScope: statement $name.insertionFormatter: PRIVATE_CAMEL_CASE $value.wrapperScope: statement - const $name = ${value/^([^;]*);?$/$1/}; --- name: constantDeclarationWithType description: Constant variable declaration with type language: typescript | javascript | typescriptreact | javascriptreact insertionScope: statement $name.insertionFormatter: PRIVATE_CAMEL_CASE $value.wrapperScope: statement - const $name: $type = ${value/^([^;]*);?$/$1/}; --- name: letDeclaration description: Let variable declaration language: typescript | javascript | typescriptreact | javascriptreact insertionScope: statement $name.insertionFormatter: PRIVATE_CAMEL_CASE $value.wrapperScope: statement - let $name = ${value/^([^;]*);?$/$1/}; --- name: letDeclarationWithType description: Let variable declaration with type language: typescript | javascript | typescriptreact | javascriptreact insertionScope: statement $name.insertionFormatter: PRIVATE_CAMEL_CASE $value.wrapperScope: statement - let $name: $type = ${value/^([^;]*);?$/$1/}; --- ``` --------- Co-authored-by: Pokey Rule <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Input:
Output:
Note how for all fields other than
language
(egname
,description
, etc) it just takes the value from the final snippet and puts them at the top of the file.The text was updated successfully, but these errors were encountered: