Skip to content

Commit 30abdcd

Browse files
committed
init extension
0 parents  commit 30abdcd

File tree

11 files changed

+600
-0
lines changed

11 files changed

+600
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Set default behavior to automatically normalize line endings.
2+
* text=auto

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
*.vsix

.vscode/launch.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// A launch configuration that launches the extension inside a new window
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
{
6+
"version": "0.2.0",
7+
"configurations": [
8+
{
9+
"name": "Extension",
10+
"type": "extensionHost",
11+
"request": "launch",
12+
"args": [
13+
"--extensionDevelopmentPath=${workspaceFolder}"
14+
]
15+
}
16+
]
17+
}

.vscodeignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.vscode/**
2+
.vscode-test/**
3+
.gitignore
4+
vsc-extension-quickstart.md

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Change Log
2+
3+
All notable changes to the "vue-script-setup-snippets" extension will be documented in this file.
4+
5+
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
6+
7+
## [Unreleased]
8+
9+
- Initial release

README.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Vue `script setup` snippets
2+
3+
4+
5+
6+
<img alt="logo" src="/img/logo.png" width="200" height="200"/>
7+
8+
In VSCode search for **`vue-script-setup-snippets`** and install it.
9+
10+
## Features
11+
12+
This extension adds snippets for [Vue 3 script setup](https://vuejs.org/api/composition-api-setup.html) syntax.
13+
14+
15+
## Snippets
16+
17+
>Note: `$1`, `$2`, etc. are placeholders. Press `Tab` to jump between placeholders.
18+
19+
| Snippet | Purpose |
20+
| ------- | ------- |
21+
| `s-file` | Vue 3 script setup file |
22+
| `s-file-ts` | Vue 3 script setup file with typescript |
23+
|`s-ref` | `const $1 = ref($2)` |
24+
|`s-ref-ts` | `const $1: Ref<$2> = ref($3)` |
25+
|`s-props` | `const $1 = defineProps<$2>()` |
26+
|`s-props-ts` | `const $1 = defineProps<$2>()` |
27+
|`s-emit` | `const $1 = defineEmit<$2>()` |
28+
|`s-emit-ts` | `const $1 = defineEmit<$2>()` |
29+
|`s-context` | `const $1 = defineContext<$2>()` |
30+
|`s-context-ts` | `const $1 = defineContext<$2>()` |
31+
|`s-computed` | `const $1 = computed(() => $2)` |
32+
|`s-computed-ts` | `const $1: Ref<$2> = computed(() => $3)` |
33+
|`s-watch` | `watch($1, ($2) => { $3 })` |
34+
|`s-watch-getter` | `watch(()=>$1, ($2) => { $3 })` |
35+
|`s-ronly` | `const $1 = readonly($2)` |
36+
|`s-ronly-ts` | `const $1: Readonly<Ref<$2>> = readonly($3)` |
37+
|`s-weffect` | `watchEffect(() => { $1 })` |
38+
|`s-wpeffect` | `watchPostEffect(() => { $1 })` |
39+
|`s-wseffect` | `watchSyncEffect(() => { $1 })` |
40+
|`s-prvd` | `const $1 = provide($2, $3)` |
41+
|`s-prvd-ts` | `const $1: InjectionKey<$2> = provide($3, $4)` |
42+
|`s-inject` | `const $1 = inject($2, $3)` |
43+
|`s-inject-ts` | `const $1: Ref<$2> = inject($3, $4)` |
44+
|`s-mnt` | `onMounted(() => { $1 })` |
45+
|`s-upd` | `onUpdated(() => { $1 })` |
46+
|`s-umnt` | `onUnmounted(() => { $1 })` |
47+
|`s-bmnt` | `onBeforeMount(() => { $1 })` |
48+
|`s-bupd` | `onBeforeUpdate(() => { $1 })` |
49+
|`s-bumnt` | `onBeforeUnmount(() => { $1 })` |
50+
|`s-err` | `onErrorCaptured(() => { $1 })` |
51+
|`s-rtrk` | `onRenderTracked(() => { $1 })` |
52+
|`s-rtrg` | `onRenderTriggered(() => { $1 })` |
53+
|`s-act` | `onActivated(() => { $1 })` |
54+
|`s-dact` | `onDeactivated(() => { $1 })` |
55+
|`s-spf` | `onServerPrefetch(() => { $1 })` |
56+
|`s-isref` | `isRef($1)` |
57+
|`s-unref` | `unref($1)` |
58+
|`s-toref` | `toRef($1, $2)` |
59+
|`s-torefs` | `toRefs($1)` |
60+
|`s-isprx` | `isProxy($1)` |
61+
|`s-isrct` | `isReactive($1)` |
62+
|`s-isrdo` | `isReadonly($1)` |
63+
|`s-ssref` | `shallowRef($1)` |
64+
|`s-trref` | `triggerRef($1)` |
65+
|`s-csref` | `customRef(($1) => { return { get: () => $2, set: ($3) => $4 } })` |
66+
|`s-ssrct` | `shallowReactive($1)` |
67+
|`s-ssrdo` | `shallowReadonly($1)` |
68+
|`s-toraw` | `toRaw($1)` |
69+
|`s-mkraw` | `markRaw($1)` |
70+
|`s-efscp` | `effectScope(($1) => { $2 })` |
71+
|`s-curscp` | `getCurrentScope()` |
72+
|`s-ondscp` | `onScopeDispose(() => { $1 })` |

img/logo.png

44.2 KB
Loading

package.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "vue-script-setup-snippets",
3+
"displayName": "Vue script setup snippets",
4+
"description": "Snippets for script setup",
5+
"version": "0.0.1",
6+
"icon": "img/logo.png",
7+
"author": "Boussadjra Brahim",
8+
"publisher": "BoussadjraBrahim",
9+
"engines": {
10+
"vscode": "^1.74.0"
11+
},
12+
"keywords": [
13+
"Vue",
14+
"Vue 3",
15+
"Vue script setup",
16+
"Composition API",
17+
"Vue Snippets"
18+
],
19+
"categories": [
20+
"Snippets"
21+
],
22+
"contributes": {
23+
"snippets": [
24+
{
25+
"language": "vue",
26+
"path": "./snippets/vue.json"
27+
},
28+
{
29+
"language": "javascript",
30+
"path": "./snippets/vue-script.json"
31+
},
32+
{
33+
"language": "typescript",
34+
"path": "./snippets/vue-script.json"
35+
}
36+
]
37+
},
38+
"license": "MIT",
39+
"repository": {
40+
"type": "git",
41+
"url": "https://github.com/boussadjra/vue-script-setup-snippets"
42+
},
43+
"bugs": {
44+
"url": "https://github.com/boussadjra/vue-script-setup-snippets/issues"
45+
}
46+
}

0 commit comments

Comments
 (0)