We have written a Yeoman generator to help get you started.
我们写一个Yeoman生成器来作为开始。
Install Yeoman and the VS Code Extension generator from the command prompt:
从命令行安装Yeoman和VSCode扩展生成器:
npm install -g yo generator-code
The Yeoman generator will walk you through the steps required to create your customization or extension prompting for the required information.
Yeoman生成器会要求你一步步的填写相应信息来创建自定义或扩展的提示。
To launch the generator simply type the following in a command prompt:
在命令行中输入如下命令来启动生成器:
yo code
The generator can either create an extension skeleton for a new extension or create a ready-to-use extension for languages, themes or snippets based on existing TextMate definition files.
生成器可以为新的扩展创建一个扩展框架或者基于已经存在的TextMate定义文件为语言、主题和片段创建一个准备使用的扩展,
Creates an extension skeleton implementing a 'hello world' command. Use this as a starting point for your own extension.
创建一个扩展框架实现'hello world'命令。用这个作为开发你自己的扩展的起点。
package.json
file and an extension main filepackage.json
模板和扩展主文件launch.json
and tasks.json
so that F5 will compile and run your extension and attach the debuggerlaunch.json
和tasks.json
使得按F5就能编译和运行你的扩展,以及挂载调试器Once created, open VS Code on the created folder. The folder contains a file vsc-extension-quickstart.html
as a quick guide with the next steps. The extension is setup so that you get IntelliSense for the extension API.
创建成功后,打开这个被创建的文件夹。文件夹包含一个vsc-extension-quickstart.html
文件作为后续步骤的快速指南。扩展会为你配置扩展API的智能提示。
Does the same as New Extension (TypeScript)
, but for JavaScript. The extension is setup so that you get IntelliSense for the extension API.
和New Extension (TypeScript)
一样,但是是为JavaScript写的。扩展会为你配置扩展API的智能提示。
Creates an extension that contributes a new color theme based on an existing TextMate color theme.
基于已存在的TextMate颜色主题为扩展贡献一个新的颜色主题。
Once created, open VS Code on the created folder and run the extension to test the new theme.
创建成功后,用VSCode打开这个文件夹并运行扩展来测试这个新主题。 Check out vsc-extension-quickstart.html
. It's a quick guide with the next steps.
查看vsc-extension-quickstart.html
。它是后续步骤的快速指南。
Creates an extension that contributes a language with colorizer.
为带着色器的语言创建一个扩展。
Once created, open VS Code on the created folder and run the extension to test the colorization. Check out vsc-extension-quickstart.html
for the next steps. Have a look at the language configuration file that has been created and defines configuration options such what style of comments and brackets the language uses.
创建成功后,用VSCode打开这个文件夹并运行扩展来测试着色。查看vsc-extension-quickstart.html
文件了解后续步骤。看看已经创建的语言配置文件,并定义语言使用什么样的注释和括号。
Creates an extension that contributes new code snippets.
为新代码段创建一个扩展。
Once created, open VS Code on the created folder and run the extension to test the snippets. Check out vsc-extension-quickstart.html
for the next steps.
创建成功后,用VSCode打开这个文件夹并运行扩展来测试这个片段。查看vsc-extension-quickstart.html
文件了解后续步骤
To load an extension, you need to copy the files to your VS Code extensions folder. We cover this in detail here: Installing Extensions.
要加载扩展,你需要复制一些文件到你的VSCode扩展文件夹。 我们在这里进行详细介绍: 安装扩展。
Q: The yo code
generator doesn't respond to arrow keys on Windows 10.
问题: yo code
在Win10中不返回许可Keys。
A: Try starting the Yeoman generator with just yo
and then select the Code
generator.
回答: 尝试仅适用yo
启动Yeoman生成器然后再选择Code
生成器。