随风逐叶 随风逐叶
首页
  • Quick Reference (opens new window)
  • EgretEngine开发者文档 (opens new window)
  • TinaX框架
  • SSH教程
  • VSCode插件开发
关于
  • 分类
  • 标签
  • 归档

rontian

从事游戏开发10多年的老菜鸟一枚!
首页
  • Quick Reference (opens new window)
  • EgretEngine开发者文档 (opens new window)
  • TinaX框架
  • SSH教程
  • VSCode插件开发
关于
  • 分类
  • 标签
  • 归档
  • 环境配置
  • 脚手架
  • 启动与调试插件

  • Command配置

  • 发布

  • snippets
  • 插件配置

  • 常见编辑器API

  • 参考文章

脚手架

# 脚手架

安装的yo可以直接生成一个Hello World版本的插件目录。执行

yo code
1

yocode

根据提示生成样板代码:

.
CHANGELOG.md
README.md
node_modules
package-lock.json
package.json
src
tsconfig.json
vsc-extension-quickstart.md
1
2
3
4
5
6
7
8
9

其中的quickstart.md是新手引导,里面包含了对文件的作用解析、如何运行插件、测试插等等,推荐去看一看,我们在下面也会介绍一些。除此之外在package.json里也包含了很多非常重要的信息:

{
  "name": "hello-world",
	"displayName": "hello-world",
	"description": "hello-world",
	"version": "0.0.1",
	"engines": {
		"vscode": "^1.61.0"
	},
	"categories": [
		"Other"
	],
	"activationEvents": [
        "onCommand:hello-world.helloWorld"
	],
	"main": "./out/extension.js",
	"contributes": {
		"commands": [
			{
				"command": "hello-world.helloWorld",
				"title": "Hello World"
			}
		]
	},
	"scripts": {
		"vscode:prepublish": "npm run compile",
		"compile": "tsc -p ./",
		"watch": "tsc -watch -p ./",
		"pretest": "npm run compile && npm run lint",
		"lint": "eslint src --ext ts",
		"test": "node ./out/test/runTest.js"
	},
	"devDependencies": {
		"@types/vscode": "^1.61.0",
		"@types/glob": "^7.1.4",
		"@types/mocha": "^9.0.0",
		"@types/node": "14.x",
		"@typescript-eslint/eslint-plugin": "^4.31.1",
		"@typescript-eslint/parser": "^4.31.1",
		"eslint": "^7.32.0",
		"glob": "^7.1.7",
		"mocha": "^9.1.1",
		"typescript": "^4.4.3",
		"@vscode/test-electron": "^1.6.2"
	}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
上次更新: 2023/10/17, 16:50:29 访问次数: 0
环境配置
启动

← 环境配置 启动→

最近更新
01
一些Shell常用的功能写法整理
10-20
02
删除git仓库submodule的步骤
10-20
03
django基本命令
10-16
更多文章>
Copyright © 2017-2025 随风逐叶
沪ICP备18008791号-1 | 沪公网安备31011502401077号

网站访问总次数: 0次
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式