chore: refactor

This commit is contained in:
frelodev 2024-10-05 18:21:20 +02:00
parent af3cde19fc
commit 2a72104a02
3 changed files with 10 additions and 10 deletions

View file

@ -244,7 +244,7 @@ export async function resync(buffer_name: string, workspace: codemp.Workspace, e
console.log("attempts to sync", i);
break;
}
if (i == tries-1) {
if (i == tries - 1) {
vscode.window.showErrorMessage(`Failed setting buffer content after ${tries} tries`);
}
}

View file

@ -8,7 +8,7 @@ import { LOGGER, provider } from '../extension';
// TODO this "global state" should probably live elsewher but we need lo update it from these commands
export let client: codemp.Client | null = null;
export let workspace_list: string[] = [];
export let cursor_disposable : vscode.Disposable | null;
export let cursor_disposable: vscode.Disposable | null;
export async function connect() {
let config = vscode.workspace.getConfiguration('codemp');
@ -59,7 +59,7 @@ export async function join(selected: vscode.TreeItem | undefined) {
setWorkspace(await client.join_workspace(workspace_id));
if (!workspace) return;
let controller = workspace.cursor();
controller.callback(async function(controller: codemp.CursorController) {
controller.callback(async function (controller: codemp.CursorController) {
while (true) {
let event = await controller.try_recv();
if (workspace === null) {

View file

@ -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 , deleteBuffer } 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();