初始化
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
# Set default behavior to automatically normalize line endings.
|
||||
* text=auto
|
||||
@@ -0,0 +1,2 @@
|
||||
node_modules
|
||||
*.vsix
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// A launch configuration that launches the extension inside a new window
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Extension",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
.vscode/**
|
||||
.vscode-test/**
|
||||
.gitignore
|
||||
vsc-extension-quickstart.md
|
||||
@@ -0,0 +1,9 @@
|
||||
# Change Log
|
||||
|
||||
All notable changes to the "kdsnippet" extension will be documented in this file.
|
||||
|
||||
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
- Initial release
|
||||
@@ -0,0 +1,65 @@
|
||||
# kdsnippet README
|
||||
|
||||
This is the README for your extension "kdsnippet". After writing up a brief description, we recommend including the following sections.
|
||||
|
||||
## Features
|
||||
|
||||
Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.
|
||||
|
||||
For example if there is an image subfolder under your extension project workspace:
|
||||
|
||||
\!\[feature X\]\(images/feature-x.png\)
|
||||
|
||||
> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
|
||||
|
||||
## Requirements
|
||||
|
||||
If you have any requirements or dependencies, add a section describing those and how to install and configure them.
|
||||
|
||||
## Extension Settings
|
||||
|
||||
Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.
|
||||
|
||||
For example:
|
||||
|
||||
This extension contributes the following settings:
|
||||
|
||||
* `myExtension.enable`: Enable/disable this extension.
|
||||
* `myExtension.thing`: Set to `blah` to do something.
|
||||
|
||||
## Known Issues
|
||||
|
||||
Calling out known issues can help limit users opening duplicate issues against your extension.
|
||||
|
||||
## Release Notes
|
||||
|
||||
Users appreciate release notes as you update your extension.
|
||||
|
||||
### 1.0.0
|
||||
|
||||
Initial release of ...
|
||||
|
||||
### 1.0.1
|
||||
|
||||
Fixed issue #.
|
||||
|
||||
### 1.1.0
|
||||
|
||||
Added features X, Y, and Z.
|
||||
|
||||
---
|
||||
|
||||
## Working with Markdown
|
||||
|
||||
You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
|
||||
|
||||
* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux).
|
||||
* Toggle preview (`Shift+Cmd+V` on macOS or `Shift+Ctrl+V` on Windows and Linux).
|
||||
* Press `Ctrl+Space` (Windows, Linux, macOS) to see a list of Markdown snippets.
|
||||
|
||||
## For more information
|
||||
|
||||
* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
|
||||
* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)
|
||||
|
||||
**Enjoy!**
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "kdsnippet",
|
||||
"displayName": "KdSnippet",
|
||||
"description": "",
|
||||
"version": "0.0.1",
|
||||
"engines": {
|
||||
"vscode": "^1.76.0"
|
||||
},
|
||||
"categories": [
|
||||
"Snippets"
|
||||
],
|
||||
"contributes": {
|
||||
"snippets": [
|
||||
{
|
||||
"language": "typescript",
|
||||
"path": "./snippets/vue-router.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"页面路由配置": {
|
||||
"prefix": "krc",
|
||||
"body": [
|
||||
"export const ${1}Router: RouteConfig = {",
|
||||
"path: '/${1/(.*)/${1:/upcase}/ig}',",
|
||||
"path: '/${1/(.*)/${1:/capitalize}/ig}',",
|
||||
"path: '/${1/(.*)/${1:/camelcase}/ig}',",
|
||||
"path: '/${1/(.*)/${1:/pascalcase}/ig}',",
|
||||
"name: '${1/([\\w])-/$1_/ig}',",
|
||||
"component: ${CLIPBOARD},",
|
||||
"meta: {",
|
||||
"title: '${3}',",
|
||||
"${4:ignoreLogin: } ${5|true, false|},",
|
||||
"[GlobalConfigRouteMetaEnum.${6|all,Drills,Homework,CompetitionType,DrillCategories|}]: ${7|true,false|},",
|
||||
"},"
|
||||
],
|
||||
"description": "页面路由配置"
|
||||
},
|
||||
"页面路由添加非登录逻辑": {
|
||||
"prefix": "kril",
|
||||
"body": [
|
||||
"ignoreLogin: ${1|true,false|},"
|
||||
],
|
||||
"description": "页面添加非登录逻辑"
|
||||
},
|
||||
"页面路由添加全局配置Meta": {
|
||||
"prefix": "krgc",
|
||||
"body": [
|
||||
"[GlobalConfigRouteMetaEnum.${1|All,Drills,Homework,CompetitionType,DrillCategories|}]: true,"
|
||||
],
|
||||
"description": "页面路由添加全局配置加载,drill,作业drill, drill 分类 "
|
||||
},
|
||||
"页面路由Props": {
|
||||
"prefix": "krp",
|
||||
"body": [
|
||||
"props: (route) => ({",
|
||||
"...route.query,",
|
||||
"...route.params,",
|
||||
"$1",
|
||||
"}),"
|
||||
],
|
||||
"description": "页面路由添加 props"
|
||||
},
|
||||
"页面路由Props解析参数": {
|
||||
"prefix": "krpp",
|
||||
"body": [
|
||||
"${1}: route.query.${1}?${2|JSON.parse(route.query. as string ),Number(route.query.)|}:${3|null,0|}"
|
||||
],
|
||||
"description": "页面路由添加 props 参数"
|
||||
},
|
||||
"页面路由导航方法": {
|
||||
"prefix": "krnf",
|
||||
"body": [
|
||||
"export function navigateTo${1}(router: VueRouter, ${2}) {",
|
||||
" router.push({ name: ${1}Route.name, query: { ${2}} })",
|
||||
"}"
|
||||
],
|
||||
"description": "跳转到路由地址"
|
||||
},
|
||||
"页面路由导航重定向方法": {
|
||||
"prefix": "krrf",
|
||||
"body": [
|
||||
"export function replaceTo${1}(router: VueRouter, ${2}) {",
|
||||
" router.replace({ name: ${1}Route.name, query: { ${2}} })",
|
||||
"}"
|
||||
],
|
||||
"description": "替换当前路由地址"
|
||||
},
|
||||
"snake": {
|
||||
"prefix": "snake",
|
||||
"body": "${1/(^[A-Z][a-z]*|[a-z])([A-Z])?/${1:/downcase}${2:+_}${2:/downcase}/g}"
|
||||
},
|
||||
"kebab-base": {
|
||||
"prefix": "kebab",
|
||||
"body": "${1/(^[A-Z][a-z]*|[a-z])([A-Z])?/${1:/downcase}${2:+-}${2:/downcase}/g} ---- ${2}"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
# Welcome to your VS Code Extension
|
||||
|
||||
## What's in the folder
|
||||
|
||||
* This folder contains all of the files necessary for your extension.
|
||||
* `package.json` - this is the manifest file that defines the location of the snippet file and specifies the language of the snippets.
|
||||
* `snippets/snippets.code-snippets` - the file containing all snippets.
|
||||
|
||||
## Get up and running straight away
|
||||
|
||||
* Press `F5` to open a new window with your extension loaded.
|
||||
* Create a new file with a file name suffix matching your language.
|
||||
* Verify that your snippets are proposed on IntelliSense.
|
||||
|
||||
## Make changes
|
||||
|
||||
* You can relaunch the extension from the debug toolbar after making changes to the files listed above.
|
||||
* You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes.
|
||||
|
||||
## Install your extension
|
||||
|
||||
* To start using your extension with Visual Studio Code copy it into the `<user home>/.vscode/extensions` folder and restart Code.
|
||||
* To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension.
|
||||
Reference in New Issue
Block a user