From ed859f06303530ce99fe738b7de7ee13c1dffaea Mon Sep 17 00:00:00 2001 From: frelodev Date: Sun, 1 Oct 2023 10:51:28 +0200 Subject: [PATCH] New features: creating buffers --- package.json | 4 ++++ src/extension.ts | 12 +++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index f52e4a2..384192b 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,10 @@ "command": "codempvscode.join", "title": "Join a codemp workspace" }, + { + "command": "codempvscode.createBuffer", + "title": "create a codemp buffer" + }, { "command": "codempvscode.helloWorld", "title": "Hello World (debug)" diff --git a/src/extension.ts b/src/extension.ts index 2366215..dfd2253 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -27,8 +27,10 @@ export function activate(context: vscode.ExtensionContext) { }); let connectCommand = vscode.commands.registerCommand('codempvscode.connect', connect); let joinCommand = vscode.commands.registerCommand('codempvscode.join', join); + let createBufferCommand = vscode.commands.registerCommand('codempvscode.createBuffer', createBuffer); context.subscriptions.push(connectCommand); context.subscriptions.push(joinCommand); + context.subscriptions.push(createBufferCommand); context.subscriptions.push(disposable); } @@ -114,9 +116,13 @@ async function join() { } - - - +async function createBuffer(){ + let buffer : string = (await vscode.window.showInputBox({prompt: "path of the buffer to create"}))!; + console.log("new buffer created ", buffer, "\n"); + codemp.create(buffer); + console.log("new createdBuffer ", createBuffer, "\n"); + //TODO push all the current opened file onto the buffer +}