-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add vscode snippets and playground launch config
- Loading branch information
Showing
4 changed files
with
98 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"group": "build", | ||
"type": "npm", | ||
"script": "dev", | ||
"path": "apps/playground", | ||
"problemMatcher": [ | ||
"$vite" | ||
], | ||
"label": "Run playground dev server", | ||
"isBackground": true, | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
// Place your webcrack workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and | ||
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope | ||
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is | ||
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | ||
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. | ||
// Placeholders with the same ids are connected. | ||
// Example: | ||
// "Print to console": { | ||
// "scope": "javascript,typescript", | ||
// "prefix": "log", | ||
// "body": [ | ||
// "console.log('$1');", | ||
// "$2" | ||
// ], | ||
// "description": "Log output to console", | ||
"scope": "typescript", | ||
// } | ||
"Transform": { | ||
"prefix": ["tra", "export transform"], | ||
"body": [ | ||
"import * as t from '@babel/types';", | ||
"import * as m from '@codemod/matchers';", | ||
// https://github.com/microsoft/vscode/issues/37570#issuecomment-672199343 | ||
"import { Transform } from '${TM_DIRECTORY/.*src(\\/[^\\/]*)(\\/[^\\/]*)?(\\/[^\\/]*)?(\\/[^\\/]*)?(\\/[^\\/]*)?(\\/[^\\/]*)?/${1:+../}${2:+../}${3:+../}${4:+../}${5:+../}${6:+../}/}ast-utils';", | ||
"", | ||
"export default {", | ||
" name: '${TM_FILENAME_BASE/[A-Z]/-${0:/downcase}/g}',", | ||
" tags: ['${1|safe,unsafe|}'],", | ||
" visitor() {", | ||
" return {", | ||
" ${3:Expression}: {", | ||
" exit(path) {", | ||
" $0", | ||
" },", | ||
" },", | ||
" };", | ||
" },", | ||
"} satisfies Transform;", | ||
"" | ||
], | ||
"description": "Transform",, | ||
"scope": "typescript", | ||
}, | ||
"Comment": { | ||
"prefix": ".comment", | ||
"body": [".addComment('leading', '${0:text}');"], | ||
"description": "Add a leading comment to a NodePath", | ||
"scope": "typescript", | ||
}, | ||
"Save": { | ||
"prefix": "save", | ||
"body": [ | ||
"// HACK: remove after testing", | ||
"writeFileSync(", | ||
" '$WORKSPACE_FOLDER/${1:save $TM_FILENAME_BASE:$TM_LINE_NUMBER}.js',", | ||
" String(${2:path})", | ||
");", | ||
"$0" | ||
], | ||
"description": "Save the generated code of a NodePath to a file", | ||
"scope": "typescript", | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters