Я создаю новое расширение для панели инструментов в сравнении с кодом. Как я могу добавить панель инструментов в моем новом расширении, как показано ниже по ссылке. Возможно ли это??
"https://dzone.com/articles/working-with-the-ignite-ui-for-angular-toolbox-ext"
package.json:
{
"name": "navcast-10-2-2019",
"displayName": "Navcast 10-2-2019",
"description": "A nice extension",
"version": "0.0.1",
"engines": {
"vscode": "^1.31.0"
},
"categories": [
"Other"
],
"activationEvents": [
"onCommand:extension.helloWorld"
],
"main": "./out/extension.js",
"contributes": {
"commands": [
{
"command": "extension.createGist",
"title": "CreateGist"
}
],
"menus": {
"editor/context": [
{
"command": "extension.createGist",
"group": "YourGroup@1"
}
]
}
},
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"postinstall": "node ./node_modules/vscode/bin/install",
"test": "npm run compile && node ./node_modules/vscode/bin/test"
},
"devDependencies": {
"typescript": "^3.3.1",
"vscode": "^1.1.28",
"tslint": "^5.12.1",
"@types/node": "^10.12.21",
"@types/mocha": "^2.2.42"
},
"dependencies": {
"opn": "^4.0.2"
}
}
extension.ts:
const vscode = require("vscode");
const editor = vscode.window.activeTextEditor;
const rp = require("request-promise");
async function CreateGist() {
const text = editor.document.getText(editor.selection);
// User Input to name Gist file
const gistName = await vscode.window.showInputBox({
placeHolder: "Name Your GistTest"
});
const options = {
method: "POST",
uri: "https://api.github.com/gists",
headers: {
"User-Agent": "Request-Promise"
},
body: {
description: "the description for this gist",
public: true,
files: {}
},
json: true
};
options.body.files[gistName] = { content: text };
rp(options).then(r => {
const parsedUrl = vscode.Uri.parse(r.html_url);
vscode.commands.executeCommand("vscode.open", parsedUrl);
});
}
function activate(context: vscode.ExtensionContext) {
// this code runs whenever your click 'Create Gist' from the context menu in your browser.
let disposable = vscode.commands.registerCommand(
"extension.createGist",
function() {
CreateGist();
}
);
context.subscriptions.push(disposable);
}
exports.activate = activate;
function deactivate() {}
exports.deactivate = deactivate;