codemp-vscode/client/vscode/src/extension.js

21 lines
527 B
JavaScript
Raw Normal View History

const vscode = require("vscode");
2023-07-03 01:38:09 +02:00
const codemp = require("./codemp.node");
2023-07-03 01:38:09 +02:00
var CLIENT = null
2023-07-03 01:38:09 +02:00
async function activate(context) {
// This must match the command property in the package.json
const commandID = "codemp.connect";
2023-07-03 01:38:09 +02:00
let disposable = vscode.commands.registerCommand(commandID, connect);
context.subscriptions.push(disposable);
}
2023-07-03 01:38:09 +02:00
async function connect() {
CLIENT = await codemp.connect("http://fantabos.co:50051")
vscode.window.showInformationMessage("Connected to CodeMP!");
}
2023-07-03 01:38:09 +02:00
module.exports = {
activate,
}