mirror of
https://github.com/hexedtech/codemp-vscode.git
synced 2024-11-21 23:14:49 +01:00
feat: delete Buffer
This commit is contained in:
parent
4b98c836c6
commit
bec2dea2cd
3 changed files with 18 additions and 1 deletions
|
@ -163,6 +163,13 @@
|
|||
"icon": "$(arrow-down)"
|
||||
},
|
||||
{
|
||||
"command": "codemp.deleteBuffer",
|
||||
"title": "Delete Buffer",
|
||||
"category": "codemp",
|
||||
"icon": "$(arrow-down)"
|
||||
},
|
||||
{
|
||||
|
||||
"command": "codemp.sync",
|
||||
"title": "Sync",
|
||||
"category": "codemp",
|
||||
|
|
|
@ -55,3 +55,12 @@ export async function listBuffers() {
|
|||
vscode.window.showInformationMessage(buffers.join("\n"));
|
||||
provider.refresh();
|
||||
}
|
||||
|
||||
export async function deleteBuffer() {
|
||||
let bufferName: any = (await vscode.window.showInputBox({ prompt: "path of the buffer to delete" }));
|
||||
if (workspace === null) return vscode.window.showWarningMessage("Join a workspace first");
|
||||
await workspace.delete(bufferName);
|
||||
vscode.window.showInformationMessage(`Deleted buffer :${bufferName}`);
|
||||
listBuffers();
|
||||
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import * as codemp from 'codemp';
|
|||
import { client, connect, join, refresh, createWorkspace, inviteToWorkspace, listWorkspaces, leave } from './commands/client';
|
||||
import { CodempTreeProvider } from './tree';
|
||||
import * as mapping from './mapping';
|
||||
import { workspace, jump, listBuffers, createBuffer } from './commands/workspaces'
|
||||
import { workspace, jump, listBuffers, createBuffer , deleteBuffer } from './commands/workspaces'
|
||||
import { attach, share, sync, apply_changes_to_buffer, detach } from './commands/buffers'
|
||||
|
||||
export let provider = new CodempTreeProvider();
|
||||
|
@ -42,6 +42,7 @@ export function activate(context: vscode.ExtensionContext) {
|
|||
vscode.commands.registerCommand('codemp.createBuffer', createBuffer),
|
||||
vscode.commands.registerCommand('codemp.listBuffers', listBuffers),
|
||||
vscode.commands.registerCommand('codemp.detach', detach),
|
||||
vscode.commands.registerCommand('codemp.deleteBuffer', deleteBuffer),
|
||||
vscode.commands.registerCommand('codemp.sync', sync),
|
||||
vscode.commands.registerCommand('codemp.refresh', refresh),
|
||||
vscode.commands.registerCommand('codemp.jump', jump),
|
||||
|
|
Loading…
Reference in a new issue