Skip to content

Commit

Permalink
#1 #3 #4 Add button visual composer button
Browse files Browse the repository at this point in the history
  • Loading branch information
TheZoker committed Nov 13, 2018
1 parent 29b5e75 commit b181688
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 7 deletions.
37 changes: 33 additions & 4 deletions vscode-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,45 @@
"Other"
],
"activationEvents": [
"onCommand:extension.sayHello"
"onCommand:extension.createExampleProject",
"onCommand:extension.createSeedProject",
"onCommand:extension.generateUISchema"
],
"main": "./out/extension",
"contributes": {
"commands": [
{
"command": "extension.sayHello",
"title": "Hello World"
"command": "extension.createExampleProject",
"title": "Create Example Project"
},
{
"command": "extension.createSeedProject",
"title": "Create Seed Project"
},
{
"command": "extension.generateUISchema",
"title": "Generate UI Schema"
}
]
],
"menus": {
"explorer/context": [
{
"when": "explorerResourceIsFolder",
"command": "extension.createExampleProject",
"group": "jsonforms"
},
{
"when": "explorerResourceIsFolder",
"command": "extension.createSeedProject",
"group": "jsonforms"
},
{
"when": "resourceExtname == .json",
"command": "extension.generateUISchema",
"group": "jsonforms"
}
]
}
},
"scripts": {
"vscode:prepublish": "npm run compile",
Expand Down
22 changes: 19 additions & 3 deletions vscode-extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,30 @@ export function activate(context: vscode.ExtensionContext) {
// The command has been defined in the package.json file
// Now provide the implementation of the command with registerCommand
// The commandId parameter must match the command field in package.json
let disposable = vscode.commands.registerCommand('extension.sayHello', () => {
let createExampleProject = vscode.commands.registerCommand('extension.createExampleProject', (args: any) => {
// The code you place here will be executed every time your command is executed
let path = (args) ? args.path : "";
// Display a message box to the user
vscode.window.showInformationMessage('Creating example project: '+path);
});

let createSeedProject = vscode.commands.registerCommand('extension.createSeedProject', (args: any) => {
// The code you place here will be executed every time your command is executed
let path = (args) ? args.path : "";
// Display a message box to the user
vscode.window.showInformationMessage('Creating seed project: '+path);
});

let generateUISchema = vscode.commands.registerCommand('extension.generateUISchema', (args: any) => {
// The code you place here will be executed every time your command is executed
let path = (args) ? args.path : "";
// Display a message box to the user
vscode.window.showInformationMessage('Hello World!');
vscode.window.showInformationMessage('Generating UI Schema: '+path);
});

context.subscriptions.push(disposable);
context.subscriptions.push(createExampleProject);
context.subscriptions.push(createSeedProject);
context.subscriptions.push(generateUISchema);
}

// this method is called when your extension is deactivated
Expand Down

0 comments on commit b181688

Please sign in to comment.