build-system/index.js

43 lines
872 B
JavaScript

/**
* build system
* @author yutent<yutent.io@gmail.com>
* @date 2018/12/20 10:46:07
*/
const vsc = require('vscode')
const BuildSystem = require('./build_system')
function activate(ctx) {
let conf = vsc.workspace.getConfiguration('BuildSystem')
BuildSystem.__init__(conf)
vsc.window.onDidCloseTerminal(() => {
// todo...
})
vsc.workspace.onDidChangeConfiguration(_ => {
let conf = vsc.workspace.getConfiguration('BuildSystem')
BuildSystem.__init__(conf)
})
const build = vsc.commands.registerCommand('BuildSystem.build', _ => {
BuildSystem.stop()
BuildSystem.build()
})
const stop = vsc.commands.registerCommand('BuildSystem.stop', _ => {
BuildSystem.stop()
})
ctx.subscriptions.push(build)
ctx.subscriptions.push(stop)
}
function deactivate() {}
exports.activate = activate
exports.deactivate = deactivate
🔥 类似sublime的Build System功能, 方便快速调试一些代码片断或想法。
JavaScript 96.6%
Python 2.2%
Dart 0.7%
PHP 0.5%