This repository has been archived on 2022-01-28. You can view files and clone it, but cannot push or open issues or pull requests.
Marlin-Artillery-M600/buildroot/share/vscode/AutoBuildMarlin/extension.js

45 lines
1.8 KiB
JavaScript
Raw Normal View History

'use strict';
var vscode = require('vscode');
function activate(context) {
console.log('Extension "AutoBuildMarlin" is now active!');
var NEXT_TERM_ID = 1;
2019-09-30 09:55:57 +02:00
var mf_build = vscode.commands.registerCommand('mfbuild', function () {
vscode.commands.executeCommand('workbench.action.files.saveAll');
2019-09-30 09:55:57 +02:00
const terminal = vscode.window.createTerminal(`Marlin Build #${NEXT_TERM_ID++}`);
terminal.show(true);
terminal.sendText("python buildroot/share/atom/auto_build.py build");
});
2019-09-30 09:55:57 +02:00
var mf_upload = vscode.commands.registerCommand('mfupload', function () {
vscode.commands.executeCommand('workbench.action.files.saveAll');
2019-09-30 09:55:57 +02:00
const terminal = vscode.window.createTerminal(`Marlin Upload #${NEXT_TERM_ID++}`);
terminal.show(true);
terminal.sendText("python buildroot/share/atom/auto_build.py upload");
});
2019-09-30 09:55:57 +02:00
var mf_traceback = vscode.commands.registerCommand('mftraceback', function () {
vscode.commands.executeCommand('workbench.action.files.saveAll');
2019-09-30 09:55:57 +02:00
const terminal = vscode.window.createTerminal(`Marlin Traceback #${NEXT_TERM_ID++}`);
terminal.show(true);
terminal.sendText("python buildroot/share/atom/auto_build.py traceback");
});
2019-09-30 09:55:57 +02:00
var mf_clean = vscode.commands.registerCommand('mfclean', function () {
const terminal = vscode.window.createTerminal(`Marlin Clean #${NEXT_TERM_ID++}`);
terminal.show(true);
terminal.sendText("python buildroot/share/atom/auto_build.py clean");
});
2019-09-30 09:55:57 +02:00
context.subscriptions.push(mf_build);
context.subscriptions.push(mf_upload);
context.subscriptions.push(mf_traceback);
context.subscriptions.push(mf_clean);
}
exports.activate = activate;
// this method is called when your extension is deactivated
function deactivate() {
}
exports.deactivate = deactivate;