VsCode Extensio 扩展开发之命令笔记

VsCode Extension 扩展开发,基本是以Command命令为核心的。开发一个命令是三个地方:
1、js代码:

		// Display a message box to the user
		vscode.window.showInformationMessage('Hello Vs Code Extension!');
	});
	context.subscriptions.push(disposable);

2、定义命令package.json

	"contributes": {
		"commands": [
			{
				"command": "extension.helloWorld",
				"title": "Hello World"
			}
		]
	},

3、还是packag.json

	"activationEvents": [
		"onCommand:extension.helloWorld"
	]

这里特别要注意,在命令uri前面加个onCommand:

width="800" height="600" src="//player.bilibili.com/player.html?aid=49731529&page=1" scrolling="no" border="0" allowfullscreen="true">
发布了195 篇原创文章 · 获赞 47 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/rocshaw/article/details/89468085