{"id":16347074,"url":"https://github.com/ospoon/key-words","last_synced_at":"2025-11-09T02:30:26.419Z","repository":{"id":105557071,"uuid":"418321259","full_name":"OSpoon/key-words","owner":"OSpoon","description":null,"archived":false,"fork":false,"pushed_at":"2021-10-18T02:54:48.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-28T06:09:40.654Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OSpoon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-18T02:48:38.000Z","updated_at":"2021-10-18T02:54:51.000Z","dependencies_parsed_at":"2024-03-30T19:01:25.804Z","dependency_job_id":null,"html_url":"https://github.com/OSpoon/key-words","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSpoon%2Fkey-words","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSpoon%2Fkey-words/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSpoon%2Fkey-words/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSpoon%2Fkey-words/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OSpoon","download_url":"https://codeload.github.com/OSpoon/key-words/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239565664,"owners_count":19660158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T00:39:33.600Z","updated_at":"2025-11-09T02:30:26.376Z","avatar_url":"https://github.com/OSpoon.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"## VSCode 自动补全插件编写到发布\n### 前言\n通过编写代码片段来实现按自己要求自动补全的功能，在一些项目中总会总结出一些规范的关键字或常用的单词，避免重复造词又懒得记忆，我们通过插件来做提示也未尝不可，顺便熟悉一下VSCode插件的编写到发布的流程。\n### 准备自动补全的配置文件：\n\n1.  通过VSCode快捷键`Ctrl+Shift+P`,输入`User Snippets`来创建一份代码片段,在什么语言环境中支持可以自行选择。 \n1.  内容请参照默认生成的注释来进行配置： \n```json\n{\n\t\"Key Word （get）\": {\n\t\t\"scope\": \"javascript,typescript\",\n\t\t\"prefix\": \"kw.get\",\n\t\t\"body\": [\n\t\t\t\"get$1\",\n\t\t\t\"$2\"\n\t\t],\n\t\t\"description\": \"获取\"\n\t}\n}\n```\n\n\n### 通过脚手架生成插件项目\n\n1. 键入依赖安装命令：`npm i -g yo generator-code vsce`；\n1. 键入创建插件命令：`yo code`命令后选择`New Code Snippets`；\n\n![image.png](https://cdn.nlark.com/yuque/0/2021/png/2373519/1634525105567-0c1289fd-3fd6-4572-9b7f-3b4bd50138c9.png#clientId=ueadae60d-bf38-4\u0026from=paste\u0026height=444\u0026id=ub50aa883\u0026margin=%5Bobject%20Object%5D\u0026name=image.png\u0026originHeight=444\u0026originWidth=469\u0026originalType=binary\u0026ratio=1\u0026size=22668\u0026status=done\u0026style=none\u0026taskId=u494769ed-bbbb-44e4-b8af-ebae9515ae9\u0026width=469)\n\n3. 将准备好的配置文件内容覆盖到`snippets`文件夹的文件中；\n3. 完善`package.json`的内容为自己的信息；\n3. 更新`README.md`文件（必须修改，按自己要求或者随便改）；\n3. 键入打包命令：`vsce package`，生成后的文件可以分享安装。\n### 准备发布插件的账号信息\n\n1.  准备微软账号：[https://login.microsoftonline.com/](https://login.microsoftonline.com/) \n\n![image.png](https://cdn.nlark.com/yuque/0/2021/png/2373519/1634524507299-d1bd0d07-d6c9-44d9-9809-fa6ca61dfedd.png#clientId=ueadae60d-bf38-4\u0026from=paste\u0026height=460\u0026id=uc8acd606\u0026margin=%5Bobject%20Object%5D\u0026name=image.png\u0026originHeight=460\u0026originWidth=556\u0026originalType=binary\u0026ratio=1\u0026size=61948\u0026status=done\u0026style=none\u0026taskId=u31de6535-cdf7-4a64-848f-d8983199347\u0026width=556)\n\n2.  创建组织：[https://aex.dev.azure.com/me?mkt=zh-CN](https://aex.dev.azure.com/me?mkt=zh-CN) \n\n![image.png](https://cdn.nlark.com/yuque/0/2021/png/2373519/1634524367431-1423e756-3ef8-454f-a841-3f01b7d41dfd.png#clientId=ueadae60d-bf38-4\u0026from=paste\u0026height=360\u0026id=fSR2Y\u0026margin=%5Bobject%20Object%5D\u0026name=image.png\u0026originHeight=360\u0026originWidth=1250\u0026originalType=binary\u0026ratio=1\u0026size=34063\u0026status=done\u0026style=none\u0026taskId=ud235e05e-ab4d-42d2-9e47-fa27a13047e\u0026width=1250)\n\n3.  跳转到组织并创建Personal Access Tokens：\nhttps://dev.azure.com/\u003c组织名称\u003e/ \n\n![image.png](https://cdn.nlark.com/yuque/0/2021/png/2373519/1634524389602-5a6d495f-1eed-4b9d-9180-420b9bb389da.png#clientId=ueadae60d-bf38-4\u0026from=paste\u0026height=463\u0026id=u1babc24f\u0026margin=%5Bobject%20Object%5D\u0026name=image.png\u0026originHeight=463\u0026originWidth=1907\u0026originalType=binary\u0026ratio=1\u0026size=43118\u0026status=done\u0026style=none\u0026taskId=u02d5954f-b5b5-4884-91ce-84842760851\u0026width=1907)\n\n4.  创建publisher，原有的命令已不支持：[https://aka.ms/vscode-create-publisher](https://aka.ms/vscode-create-publisher) \n\n![image.png](https://cdn.nlark.com/yuque/0/2021/png/2373519/1634524324339-67804987-a50e-48a7-aad8-642ac7d00ba7.png#clientId=ueadae60d-bf38-4\u0026from=paste\u0026height=45\u0026id=u6a00a4c3\u0026margin=%5Bobject%20Object%5D\u0026name=image.png\u0026originHeight=45\u0026originWidth=1096\u0026originalType=binary\u0026ratio=1\u0026size=6646\u0026status=done\u0026style=none\u0026taskId=uc94fd783-4799-4c3f-bd13-d58622a3cc2\u0026width=1096)\n\n5.  插件插件发布情况：[https://marketplace.visualstudio.com/](https://marketplace.visualstudio.com/) \n\n![image.png](https://cdn.nlark.com/yuque/0/2021/png/2373519/1634524278305-58365b21-ebb9-4543-a188-f25809ea3818.png#clientId=ueadae60d-bf38-4\u0026from=paste\u0026height=288\u0026id=u3c6cf36f\u0026margin=%5Bobject%20Object%5D\u0026name=image.png\u0026originHeight=288\u0026originWidth=1225\u0026originalType=binary\u0026ratio=1\u0026size=34754\u0026status=done\u0026style=none\u0026taskId=u4e534ae7-87f6-4a10-b2c7-b9eb993d01e\u0026width=1225)\n一顿注册完还没搞定的联系我一下，谁知道我都整了啥。\n\n6. 执行发布脚本\n\u003e 执行期间需要输入token进行登录验证\n\n```sh\n#!/usr/bin/env bash\necho '请进行登录相关操作：'\nvsce login publisher-name # 登陆\nvsce package # 打包\necho \"-------publishing-------\"\nvsce publish # 发布\necho \"发布结束\"\nexit\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fospoon%2Fkey-words","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fospoon%2Fkey-words","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fospoon%2Fkey-words/lists"}