fix: correctly declare extension

This commit is contained in:
əlemi 2023-07-03 01:38:09 +02:00
parent 9584707982
commit e2176fd1fc
2 changed files with 15 additions and 14 deletions

View file

@ -1,8 +1,8 @@
{
"name": "codemp-vscode",
"name": "codemp",
"version": "0.0.1",
"description": "VSCode extension for CodeMP",
"main": "index.node",
"main": "./out/extension.js",
"engines": {
"vscode": "^1.32.0"
},
@ -17,12 +17,12 @@
"contributes": {
"commands": [
{
"command": "example.helloWorld",
"title": "Hello World"
"command": "codemp.connect",
"title": "Connect"
}
]
},
"activationEvents": [
"onCommand:example.helloWorld"
"onCommand:codemp.connect"
]
}

View file

@ -1,19 +1,20 @@
const vscode = require("vscode");
const codemp = require("./codemp.node");
module.exports = {
activate,
deactivate,
};
var CLIENT = null
function activate(context) {
async function activate(context) {
// This must match the command property in the package.json
const commandID = "codemp.connect";
let disposable = vscode.commands.registerCommand(commandID, sayHello);
let disposable = vscode.commands.registerCommand(commandID, connect);
context.subscriptions.push(disposable);
}
function connect() {
vscode.window.showInformationMessage("Connecting to CodeMP!");
async function connect() {
CLIENT = await codemp.connect("http://fantabos.co:50051")
vscode.window.showInformationMessage("Connected to CodeMP!");
}
function deactivate() {}
module.exports = {
activate,
}