yo code # ? What type of extension do you want to create? New Extension ( JavaScript ) # ? What's the name of your extension? HelloWorld ### 下面的选择全部直接「回车」使用默认值 ### # ? What's the identifier of your extension? helloworld # ? What's the description of your extension? LEAVE BLANK # ? Initialize a git repository? Yes # ? Which package manager to use? npm
使用 VSCode 打开项目目录
1
code ./helloworld
按F5打开「Extension Development Host」窗口,按Ctrl+Shit+P进入「Command Palette」,输入「Hello World」执行这个项目
在这个新的窗口中会出现「Hello World」的通知,任务完成!
Modify Code
打开extension.js,修改代码为
1
vscode.window.showInformationMessage('Hello World from VSCode!');
Error: Make sure to edit the README.md file before you publish your extension
删除 README.MD 文件中开头的一段文字 ( This is the README for your extension “hello world”. After writing up a brief description, we recommend including the following sections. )
A『repository』field is missing from the ‘package.json’ manifest file .Do you want to continue? [y/n]